2010-10-23 57 views

回答

0

您想使用命令行實用程序osacompile。下面將在桌面上創建一個空白的AppleScript稱爲「test.scptd」

set applescriptCode to "" 
set applescriptPath to (path to desktop as text) & "test.scptd" 

do shell script "echo " & applescriptCode & " | osacompile -o " & quoted form of POSIX path of applescriptPath 
+0

非常感謝,但我不斷收到此錯誤: 錯誤「搜索得到了一個錯誤:osacompile:無法寫入文件/庫/應用程序支持/應用程序/ Script.scpt:沒有這樣的文件或目錄「號碼1 – 2010-10-29 17:56:37

+0

錯誤聽起來像你的路徑有問題。既然你沒有顯示任何你的代碼,我不能確定。我確定我的代碼是按照原樣工作的,所以無論你改變了什麼都會搞砸。 – regulus6633 2010-10-31 03:33:30