AppleScript在Acrobat中将pdf保存为pdf-x [英] AppleScript to save pdf as pdf-x in Acrobat

查看:180
本文介绍了AppleScript在Acrobat中将pdf保存为pdf-x的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在macOS Sierra上使用Adobe Acrobat Pro DC 2015.23. 我的目标是创建可以执行以下操作的AppleScript:

I am currently using Adobe Acrobat Pro DC 2015.23 on macOS Sierra. My goal is to create AppleScript that do such things:

  1. 打开PDF文件
  2. 将此文件保存为pdf-x格式
  3. 关闭文件

我创建了AppleScript,可以执行所有步骤,但是我找不到任何文档来选择如何在保存时使用PDF标准.

I create AppleScript, that do all steps, but i can't find any documentation how to choose with PDF standard to use while saving.

如果我想手动执行此操作,请执行以下步骤:

If I want to do this manually I do following steps:

  1. 在Adobe Acrobat中打开PDF
  2. 选择PDF标准菜单
  3. 单击(另存为PDF/X)
  4. 按保存

问题是保存时如何设置PDF/X标准.

我的脚本

on is_running(appName)
    tell application "System Events" to (name of processes) contains appName
end is_running

set theFiles to choose file with prompt "Select the files" of type {"pdf"} with multiple selections allowed

set aaRunning to is_running("Adobe Acrobat")

tell application "Adobe Acrobat"
    repeat with theFile in theFiles
        open theFile without dialogs
        save active doc to theFile
        close active doc
    end repeat
    if not aaRunning then
        quit
    end if
end tell

推荐答案

您可能已经注意到,Applecroft对Acrobat的支持非常有限.

As you may have noted, Applescript support of Acrobat is very limited.

就这样,我想到了以下可能的工作流程:

Just so, the following possible workflows come to my mind:

a)您可以使用预检规范来创建PDF/X(如果您手动进行操作,这也是引擎).您可以使用Acrobat JavaScript运行/应用预检规范,也可以使用do script Applscript命令运行Acrobat JavaScript.

a) you can use Preflight Profiles to create PDF/X (this is also the engine if you do it manually). You can run/apply Preflight Profiles using Acrobat JavaScript, and you can run Acrobat JavaScripts using the do script Applscript command.

b)您创建一个预检滴,该预滴将生成一个相应的PDF/X文件.然后,您可以使用Applescript打开该小滴中的文档(文件).

b) you create a Preflight Droplet which makes an according PDF/X file. You then can use Applescript to open the document (file) in that droplet.

c)您使用系统事件来控制Acrobat的用户界面元素.换句话说,您可以执行手动操作,但是要使用系统事件.您可能想使用实用程序(例如UI浏览器)来找到解决各种对话框元素的方法.

c) you use System Events to control the user interface elements of Acrobat. In other words, you do what you would do manually, but using System Events. You may want to use an utility, such as UI Browser to find the ways to address the various dialog elements.

这篇关于AppleScript在Acrobat中将pdf保存为pdf-x的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆