我有一个简短的脚本,可以在运行AppleScript后开始在Spotify搜索特定歌曲的地方开始工作,但是出现此错误似乎只是小牛在提示(经过一小段谷歌搜索之后) 。
tell application "Spotify" to activate
delay 0.1
tell application "Spotify" to keystroke "l" using command down
它说
Syntax Error: Expected end of line, etc. but found identifier
并指向“使用”。现在,我只是编码了很短的时间,但是据我所知,这是很多人正在使用并已发布到SO和其他地方的确切语法。
有任何想法吗?
干杯
最佳答案
命令keystroke
属于Processes Suite。您可以使用系统事件来调用它。
tell application "Spotify" to activate
delay 0.1
tell application "System Events" to tell process "Spotify"
keystroke "l" using command down
end tell
关于AppleScript: "Expected end of line, etc. but found identifier",Mavericks错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23266980/