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/