我遇到了我编写的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