首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Applescript:“行的预期结束,等等,但找到了类名。”

Applescript:“行的预期结束,等等,但找到了类名。”
EN

Stack Overflow用户
提问于 2016-04-12 15:08:22
回答 1查看 1.7K关注 0票数 2

我一直在做一个AppleScript,我收到了以下错误:/Users/MYUSER/taskmaster/chromeCanary/lib/overrideOpenChrome.scpt:373:377: script error: Expected end of line, etc. but found class name.

奇怪的是,这个脚本以前似乎工作过,所以我更加困惑,脚本如下:

代码语言:javascript
复制
 #!/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 

我的问题在哪里?路径是正确的,我又检查了又检查,所以不可能是那样的。

编辑:,我很蠢。如果你在同样的/相似的错误中偶然发现了这个问题,请看我下面的答案。

EN

回答 1

Stack Overflow用户

发布于 2016-04-13 15:30:01

好的,显然您不能使用with icon file & display notification,您只能在display dialog中使用它。你能得到的最接近的就是乱动应用程序的图标。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36577257

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档