2016-11-08 54 views
1

僅有3腳本的行如何調試液滴能夠不留的AppleScript編輯使用AppleScript

set fich to POSIX file "/Appli/conv2spct.app" as string 

tell application "Finder" to open POSIX file "/Users/yourusername/Desktop/somefile" using application file fich 

如果在你的液滴錯誤顯示的對話框將通過腳本編輯器中打開測試液滴的應用AppleScript的

+0

好東西,但我建議更清楚爲什麼你的代碼是必要的(腳本編輯器將啓動正在開發的保持打開的應用程序,但不會保持打開狀態)。我建議在問題中解釋解決方案的必要性,並將兩種解決方案都轉化爲答案。 – mklement0

回答

0

下面是使用do shell script務實的選擇,這可能允許你指定多個文件參數:

do shell script "open -a /Appli/conv2spct.app ~/Desktop/somefile1 ~/Desktop/somefile2" 

以上路徑發生並不需要引用(轉義)爲外殼,但使用變量時指定文件路徑,它最好使用quoted form of(傳遞多個參數,適用每quoted form of):

do shell script "open -a " & quoted form of fileappli & " " & quoted form of fileargument 
1

與選擇文件的2個元素

set fileappli to POSIX path choose file of type {"APPL"} with prompt "Choose a Droplet application to debug"--the droplet for debug 

set fileargument to POSIX path choose file --the file argument to pass at droplet 

tell application "Finder" to open fileargument using application file fileappli 

如果在你的液滴錯誤顯示的對話框將被T打開相同的腳本他的腳本編輯器AppleScript的