我编写了下面的applescript来打开一个文档,同时在我的文字处理器应用程序中隐藏了一些恼人的持久工具栏。当我直接从脚本编辑器中播放时,它很好用。但是当我把它变成一个应用程序,试着在阿尔弗雷德(而不是阿尔弗雷德2)上玩的时候,我就明白了:
Open "Bicycle" is not allowed assistive access. System Events got an error: Open "Bicycle" is not allowed assistive access. (-1719)哦,我试过比"POSIX“更普通的路线,但都带来了同样的结果。另外,我正在运行最新版本的El Capitan。
tell application "Bean"
open POSIX file "/Users/MyDrive/Documents/Bicycle.rtf"
end tell
activate application "Bean"
delay 0.3
tell application "System Events"
tell process "Bean"
click menu item "Hide Ruler" of menu 1 of menu bar item "View" of menu bar 1
click menu item "Hide Status Bar" of menu 1 of menu bar item "View" of menu bar 1
click menu item "Hide Toolbar" of menu 1 of menu bar item "View" of menu bar 1
end tell
end tell发布于 2016-03-24 21:44:45
因为
不允许使用“自行车”。
让它打开
System Preferences > Security & Privacy > Privacy > Accessibility
并选中适当的复选框。
https://stackoverflow.com/questions/36209964
复制相似问题