and*_*ent 5 applescript google-chrome alfred
我最近更新了OS Mavericks,看来我的一些处理谷歌浏览器的苹果脚本已停止正常工作.
我有一个简单的功能,打开chrome并创建一个新窗口..
on openWindow()
tell application "Google Chrome"
activate
set newWin to make new window
tell active tab of newWin to set URL to "http://play.google.com/music"
end tell
end openWindow
Run Code Online (Sandbox Code Playgroud)
但是,这给了我错误:预期的行结束但找到了属性.
参考"告诉newWin的活动标签"中的"标签".这个链接似乎提供了一些帮助,但我仍然迷失了如何解决这个问题.任何人都可以帮助我重新开始工作吗?谢谢.
我也遇到了类似的问题,也在 OS X 10.9.4 上,其中有一个非常简单的脚本
tell application "iTunes"
return persistent ID of (first source where kind is library)
end tell
Run Code Online (Sandbox Code Playgroud)
时不时地返回完全相同的错误消息:
NSAppleScriptErrorBriefMessage = "Expected end of line but found property.";
NSAppleScriptErrorMessage = "Expected end of line but found property.";
NSAppleScriptErrorNumber = "-2741";
NSAppleScriptErrorRange = "NSRange: {45, 2}";
Run Code Online (Sandbox Code Playgroud)
这不是一个真正的解决方案,但根据我的经验,计算机重新启动可以解决该问题(暂时)。对我来说,整个问题看起来像是 AppleScript 中的一个错误。
结果我同时使用 Parallels 运行 Windows 虚拟机。在虚拟机中,还有一个 iTunes 实例。本质上,我在同一系统上有两个不同版本的 iTunes。一种可以理解 AppleScript,另一种则不能。像这样解决 OS X iTunes 问题就解决了:
tell application "/Applications/iTunes.app"
return persistent ID of (first source where kind is library)
end tell
Run Code Online (Sandbox Code Playgroud)
也许原问题中的问题可以用同样的方式解决。
| 归档时间: |
|
| 查看次数: |
1898 次 |
| 最近记录: |