首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Applescript问题:“不允许辅助访问。(-1719)”

Applescript问题:“不允许辅助访问。(-1719)”
EN

Stack Overflow用户
提问于 2016-03-24 21:04:54
回答 1查看 2.1K关注 0票数 2

我编写了下面的applescript来打开一个文档,同时在我的文字处理器应用程序中隐藏了一些恼人的持久工具栏。当我直接从脚本编辑器中播放时,它很好用。但是当我把它变成一个应用程序,试着在阿尔弗雷德(而不是阿尔弗雷德2)上玩的时候,我就明白了:

代码语言:javascript
复制
Open "Bicycle" is not allowed assistive access. System Events got an error: Open "Bicycle" is not allowed assistive access. (-1719)

哦,我试过比"POSIX“更普通的路线,但都带来了同样的结果。另外,我正在运行最新版本的El Capitan。

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-03-24 21:44:45

因为

不允许使用“自行车”。

让它打开

System Preferences > Security & Privacy > Privacy > Accessibility

并选中适当的复选框。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36209964

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档