1
votes

I've been working on an AppleScript and I received this error: /Users/MYUSER/taskmaster/chromeCanary/lib/overrideOpenChrome.scpt:373:377: script error: Expected end of line, etc. but found class name.

The odd part is that this script seemed to work before so I'm at even more confused, the script is below:

 #!/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 

Where would my problem be? The paths are correct, I checked and double checked so it couldn't be that.

EDIT: I'm stupid. See my answer below if you've stumbled across this ask with the same/similar error.

1
Does your actual user account folder contain a space? In other words, where I believe you've substituted "MYUSER" for the actual information, does the actual information look something more like "Whitman Colm", with a space?ThrowBackDewd
Another note, it sounds like there may be an issue with the delay command on some versions of OSX. See [this conversation] (apple.stackexchange.com/q/161749/176513). You may want to try changing the delay to do shell script "sleep 900"ThrowBackDewd

1 Answers

0
votes

Ok, so apparently you can't use with icon file & display notification, you can only use it with display dialog. The closest you can get is messing about with the app's icon.