我遇到了我編寫的applescript的問題。該腳本需要檢查前的桌面窗口的路徑是桌面文件夾內(即前綴匹配)。這是腳本:使用AppleScript檢查前臺桌面窗口路徑是否位於Desktop文件夾內
tell application "Finder"
set currentPath to (POSIX path of (target of front window as alias))
end tell
set thecommandstring to "echo \"" & currentPath & "\" | grep -q \"^/Users/host/Desktop/\" "
set grepResult to do shell script thecommandstring
但是在執行它給人的錯誤:
error "The command exited with a non-zero status." number 1
我是AppleScript的新手,必須犯一些非常基本的錯誤。有人能告訴我我要去哪裏嗎?
我不想發佈更新,直到明天我回到我的電腦前對其進行測試。謝謝您的幫助。 – adayzdone 2012-02-20 02:34:48
它完美的作品..謝謝! – 2012-02-20 09:12:00