pdf - 使用 Applescript 进行 Photoshop 脚本编写 - 在没有提示的情况下不会打开图像

标签 pdf automation applescript photoshop

tell application "Adobe Photoshop CS5.1"
set myFile to (choose file) as string
open file myFile
end tell

这会打开两个单独的对话框,询问我要打开什么文件......我首先选择什么并不重要,它会询问第二次并打开第二个。

我想打开的是 PDF,所以我真的想要:

tell application "Adobe Photoshop CS5.1"
set myFile to (choose file) as string
open file myFile as PDF with options {class:PDF open options, mode:CMYK, resolution:300, use antialias:true, page:1} showing dialogs never
end tell

结果:

Error: General Photoshop error occurred. This functionality may not be available in this version of Photoshop

好吧,更直接的方法:

tell application "Adobe Photoshop CS5.1"
set myFilePath to alias "other: PREPRESS SAVE:GAMES:3Sudoku:20120213pzsud-v:sudoku 0213.pdf"
with timeout of 300 seconds
        open myFilePath as PDF with options {class:PDF open options, mode:CMYK, resolution:300, use antialias:true, page:1} 
end timeout
end tell

文件存在,否则别名设置失败。那么我能得到什么?

 "Error: -43. Adobe Photoshop CS5.1 got an error: File some object wasn’t found."

I had asked over on the Adobe forums, with no response.如果您有兴趣,我真正尝试使用的完整代码就在那里。我将其简化为基础知识以找出问题所在。

是否有我遗漏的地方?我不确定出了什么问题,示例是

最佳答案

Photoshop 5 词典存在严重问题。一种想法是尝试在 32 位模式下运行它,这可以“解决”很多问题。请进一步消化http://forums.adobe.com/message/2822670#2822670?tstart=0#2822670

关于pdf - 使用 Applescript 进行 Photoshop 脚本编写 - 在没有提示的情况下不会打开图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9244648/

相关文章:

terminal - 在 AppleScript 中为 "do shell script"的对话框添加进度条

AppleScript -> 激活不可编写脚本的应用程序的窗口

objective-c - 使用 AppleScript 解锁 OS-X (Mavericks) 后键盘没有响应

java - iText 阅读多列 PDF 文档

c# - ReportViewer.PrintDialog() 在打印到 Adob​​e PDF 时抛出异常

automation - Blueprism 中的右键单击选项

windows - 自动启动 Windows 录音机

user-interface - 如何自动安装 ISO(iDrac for DELL 服务器)?

.net - 使用 .net 在 pdf 中编辑 javascript

c++ - QTextDocument、QPdfWriter - 如何缩放输出