Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
自动化adobe pdf导出_Pdf_Applescript_Adobe_Adobe Indesign - Fatal编程技术网

自动化adobe pdf导出

自动化adobe pdf导出,pdf,applescript,adobe,adobe-indesign,Pdf,Applescript,Adobe,Adobe Indesign,我正在尝试使用Apple脚本自动化在Adobe indesign中导出PDF的过程, 我可以使用“Command e”命令进入导出菜单,没问题,但不能更进一步 我还尝试使用系统事件,通过以下方式选择预设,这似乎是一种更简单的方法: 文件>Adobe PDF预设>“我的预设1…” 我得到的只是“无法将(文件>Adobe PDF预设>我的预设1…”转换为整数类型 因此,我需要的帮助是浏览系统事件,以便选择要使用的预设 根据我的理解,应该是这样的: tell application "System E

我正在尝试使用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

理想情况下,您可以使用InDesign的脚本API制作PDF。如果您研究InDesign的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)

考虑使用InDead的Apple Script API来解决这个问题,而不是系统事件。这将为你更好地理解你需要做的事情。目前这个例子GIST假设,你有一个开放的设计文档,使用的PDF预置被命名为“我的预设1”,(注意:如果需要PDF预设,你需要根据需要改变第1行。“我的预设1”不存在。当前它将生成的PDF命名为与
.indd
文档相同的名称(减去
.indd
后缀并添加
.PDF
后缀)。生成的PDF将保存到您的桌面folder@RobC:正如您所说,OP应该直接在InDesign中编写脚本。我建议将您的代码作为完整的答案发布在这里。好的,我将尝试在InDesign中执行此操作。最终,我希望这是一个“快速操作”“使用automator,我可以右键单击
.indd
文件,选择快速操作,使其导出到与我选择的文件相同的目标。保留相同的名称,但带有
.pdf
后缀即可。