2012-02-11 50 views
2
tell application "Adobe Photoshop CS5.1" 
set myFile to (choose file) as string 
open file myFile 
end tell 

這導致2個單獨的對話框中打開要我開什麼文件....這不要緊,我選擇第一,它要求第二時間並打開第二個。Photoshop的腳本與AppleScript的 - 不會打開圖像,而無需提示

我想打開一個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.我真的想使用的完整代碼在那裏,如果你有興趣。我將它簡化爲基本知識來找出問題所在。

有沒有一個設置我失蹤的地方?我不確定什麼是錯的,例如

回答

1

有是Photoshop 5詞典的可怕問題。其中一個想法是嘗試以32位模式運行,它可以「解決」很多問題。請進一步在http://forums.adobe.com/message/2822670#2822670?tstart=0#2822670

+0

我能夠找到的東西,我會嘗試設置圖像(選擇提示文件「請選擇一個圖像文件:」)作爲字符串 - 這是從AppleScript的標準版AddAdditions 告訴應用程序「Adobe Photoshop CS5」 打開別名theImage - 「打開文件theImage」也應該工作(不帶引號)。 結束告訴 – Lithodora 2012-02-14 11:52:41

1

可能是一個CS5問題,但我真的不知道。

這個工作對我很好,但CS4:

tell application "Adobe Photoshop CS4" 
    set myFile to (choose file) as alias 
    with timeout of 300 seconds 
     open myFile as PDF with options {class:PDF open options, mode:CMYK, resolution:300, use antialias:true, page:1} 
    end timeout 
end tell 

唯一真正的區別(我可以看到)是我alias所選擇的文件,並調用open ... - 不open file ...

+0

進一步消化這在CS4中工作,也許這是真正的解決方案。在CS5中,這導致:「錯誤:-43。Adobe Photoshop CS5.1出現錯誤:找不到文件。」 – Lithodora 2012-02-12 01:07:42

相關問題