Reputation: 206
why doesn't my applescript run from terminal I can run it successfully from the editor
I run command
/usr/bin/osascript -e my_script.scpt
I get error
0:12: syntax error: A unknown token can’t go after this identifier. (-2740)
my script
set volume 2
set x to 0
open location "spotify:user:wunspe:playlist:meininki"
tell application "Spotify"
set the sound volume to 0
play
repeat 10 times
if sound volume is less than 70 then
set sound volume to (sound volume + 10)
set x to (x + 9)
set volume output volume x without output muted --100%
delay 3
end if
end repeat
end tell
Upvotes: 2
Views: 1233
Reputation: 63892
If you write
osascript -e "set Volume 10"
after the -e
is the full content of the script.
if you put into some file (lets call it volume.scpt
)
set Volume 10
you can call the script-file as
osascript /path/to/volume.scpt
Upvotes: 1
Reputation: 285059
To run a compiled script (file) you have to omit the -e
flag and pass the full path to the script
/usr/bin/osascript /Users/myUser/path/to/my_script.scpt
Upvotes: 3