2012-04-29 33 views

回答

1

下面是一個例子...

set someFile to (path to desktop as text) & "sample.txt" 

tell application "Finder" 
    if not (exists file someFile) then 
     -- do something here 
    end if 
end tell 
+0

謝謝您的回答。您的腳本在AppleScript編輯器中完美工作,但是當我嘗試在postInstall操作中包含我的測試時,安裝程​​序返回安裝錯誤。我是否應該返回「返回true」之類的東西來指定我的腳本執行已經成功完成? – sdespont

+1

您好,經過對網絡的少量研究,可以使用shell命令「osascript your_applescript_file.scpt」從預安裝和安裝後腳本調用「applescript」文件。 – sdespont

相關問題