【发布时间】:2016-01-27 16:22:16
【问题描述】:
我在我的 OSX 应用程序中使用 AppleScript 来激活 Finder 并使用 smb URL 打开 smb 共享文件夹。
set the clipboard to "smb://192.168.99.99"
tell application "Finder"
activate
end tell
delay 0.5
tell application "System Events"
keystroke "k" using command down
end tell
delay 0.2
tell application "System Events"
keystroke "v" using command down
keystroke return
end tell
它运行良好,但在我的一位客户的 Mac 上无法运行。 Finder 未激活,但屏幕顶部的 Finder 菜单栏显示。
我尝试在他的 Mac 上使用脚本编辑器来执行相同的脚本,但 Finder 仍然没有激活。
到目前为止,这只发生在此客户的 Mac 上。他的 Mac 运行的是 10.10,升级到 10.11 但仍然不走运。
有人知道发生了什么吗?有什么方法可以“禁用”AppleScript?
【问题讨论】:
-
在您的客户端的 Mac 上未启用 GUI 脚本,但您不需要使用 GUI 脚本来编写 Finder,因为它是本机可编写脚本的,如下面的答案所述。
标签: macos applescript finder