我一直在做一个AppleScript,我收到了以下错误:/Users/MYUSER/taskmaster/chromeCanary/lib/overrideOpenChrome.scpt:373:377: script error: Expected end of line, etc. but found class name.
奇怪的是,这个脚本以前似乎工作过,所以我更加困惑,脚本如下:
#!/usr/bin/osascript
set ccss to "/Users/MYUSER/taskmaster/chromeCanary/chromeShouldStop/bool.rtf"
set ccsr to "/Users/MYUSER/taskmaster/chromeCanary/chromeShouldRun/bool.rtf"
do shell script "mv " & ccss & " " & ccsr
tell application "Google Chrome Canary"
activate
end tell
display notification "30 Minutes remain" with title "TaskMaster" subtitle "Google Chrome Canary" with icon file "Users:MYUSER:taskmaster:assets:chrome-icon.icns"
delay 900
display notification "15 Minutes remain" with title "TaskMaster" subtitle "Google Chrome Canary" with icon file "Users:MYUSER:taskmaster:assets:chrome-icon.icns"
delay 600
display notification "5 Minutes remain" with title "TaskMaster" subtitle "Google Chrome Canary" with icon file "Users:MYUSER:taskmaster:assets:chrome-icon.icns"
delay 60
display notification "3 Minutes remain" with title "TaskMaster" subtitle "Google Chrome Canary" with icon file "Users:MYUSER:taskmaster:assets:chrome-icon.icns"
delay 60
display notification "1 Minute remain" with title "TaskMaster" subtitle "Google Chrome Canary" with icon file "Users:MYUSER:taskmaster:assets:chrome-icon.icns"
tell application "Google Chrome Canary"
quit
end tell
do shell script "mv " & ccsr & " " & ccss 我的问题在哪里?路径是正确的,我又检查了又检查,所以不可能是那样的。
编辑:,我很蠢。如果你在同样的/相似的错误中偶然发现了这个问题,请看我下面的答案。
发布于 2016-04-13 15:30:01
好的,显然您不能使用with icon file & display notification,您只能在display dialog中使用它。你能得到的最接近的就是乱动应用程序的图标。
https://stackoverflow.com/questions/36577257
复制相似问题