AppleScript调用PDF Redux打印插件失败问题及解决
Numbers打印PDF脚本问题解决记录
尝试使用PDF Redux打印插件将Numbers文件导出为PDF时,原有AppleScript无法正常打开打印对话框中的PDF菜单并选中目标插件。
原脚本代码
tell application "System Events" tell process "Numbers" set frontmost to true keystroke "p" using {option down, command down} delay 2 click menu item "PDF Redux" of menu button "PDF" of sheet 1 of window 1 end tell end tell
问题说明
原脚本无法在打印对话框中定位到PDF菜单按钮,导致执行失败。
修复后的脚本代码
通过调整UI元素的层级定位,修复后的代码如下:
perform action "AXShowMenu" of menu button 1 of group 2 of splitter group 1 of sheet 1 of window 1 click menu item 8 of menu 1 of menu button 1 of group 2 of splitter group 1 of sheet 1 of window 1
内容的提问来源于stack exchange,提问作者Angelo Antonucci
相关产品推荐
相关产品推荐

