问题描述
您好,我正在Automator中使用此Apple脚本来自动启动并使用快速的时间在全屏视频中播放。
tell application "QuickTime Player"
set theMovie to open file "Users:ronaldwise:Movies:Jarvis Startup.mp4"
tell theMovie
set the presenting to true
set the looping to false
play
end tell
end tell
当我在automator中按play时,脚本运行良好,但是,当我尝试在automator之外启动自动化应用程序时,会收到此消息。
“动作“运行AppleScript”遇到错误“未授权将Apple事件发送到QuickTime Player”
我的自动化工作流程如下
我已允许访问安全性隐私>可访问以下应用程序:终端,领事,AEServer,Automator,领事和Quicktime播放器。
我已允许访问“安全性隐私”>“磁盘访问权限完全相同”。
我已允许以下人员访问“安全性隐私”>“自动化”:Automator> QuickTime Player和Terminal> Finder
请给我任何帮助。
解决方法
该错误与辅助功能和完整磁盘访问无关
您必须在脚本应用程序的Info.plist中添加密钥NSAppleEventsUsageDescription。
使用Right-click > Show Package Contents
在Finder中打开应用程序包,然后使用文本编辑器在Info.plist
中打开Contents
文件并插入
<key>NSAppleEventsUsageDescription</key>
<string>Jarvis needs to control QuickTime Player</string>
键值对的位置无关紧要,但不能直接跟随key
行。