我正在尝试使用Apple脚本来自动化Adobe indesign中PDF的导出过程, 我可以进入导出菜单,使用“ Command e”命令可以,但是还可以。
我还尝试通过以下方式选择系统事件来尝试使用系统事件: 文件> Adobe PDF预设>“我的预设1 ...”,
我得到的只是“无法将(文件> Adobe PDF预设>“我的预设1 ...”)设置为整数类型。
因此,我需要帮助的是浏览系统事件,以便我可以选择要使用的预设。
据我了解,它应该看起来像这样:
tell application "System Events"
tell process "Adobe InDesign 2020"
set frontmost to true
delay 1
click menu item "My Preset 1..." of menu of menu item "Adobe PDF Presets" of menu "File" of menu bar 1
end tell
end tell
答案 0 :(得分:0)
理想情况下,您将使用InDesign的脚本API来制作PDF。如果您在InScript的AppleScript词典中研究“导出”条目。您将了解以下命令是可能的:
export document 1 format PDF type to *SomeOutputPath* using PDF export preset "[Smallest File Size]"
如果您确实想通过单击菜单来执行此操作,请查看InDesign的“菜单操作”和“调用”的字典条目。这些允许人们调用菜单操作:
set theAction to (menu actions whose name is "My Preset 1...")
invoke (item 1 of theAction)