You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.21 14:02:01