2016-06-22 18 views
1

新手在這裏。升級現有的Applescript/Automator程序中的Photoshop版本

我在Automator中運行Photo Booth程序。它使用此代碼運行Photoshop的動作:


on run {input, parameters} 
    --set theImage to choose file with prompt "Please select an image file:" 
    --display alert class of (theImage as alias) buttons {"OK"} as warning 

    set theImage to input 

    tell application "Adobe Photoshop CS4" 
     open file (theImage as text) as Camera RAW showing dialogs never 
     do action "OneCopyColourDFS" from "Photobooth" --replace 'name' and 'group' with the correct items from Photoshop; the "group" is the folder the action appears under in Photoshop; capitalization and spacing matter 
    end tell 

    return input 
end run 

不過,我已經更新了版本的Photoshop CS6來。但是,當我改變 - 告訴應用程序 「的Adobe的Photoshop CS4」 - 到 - 告訴應用程序 「的Adobe Photoshop CS 」 -

...並運行的Automator,它會立即切換回 'CS4'當它運行Applescript時。爲什麼?我假設它必須是Automator做些什麼?

在此先感謝您的幫助?

倫納德

+0

你有兩個版本安裝? – vadian

+0

Hi @vadian是的CS4和CS6都安裝在Appliactions中。 – LeonardJG

+0

如果你退出CS4並啓動CS6,你還看到它啓動CS4嗎? – ThrowBackDewd

回答

0

如果我沒有記錯,AppleScript的腳本將引用保存到像使用別名數據的應用程序,所以它可能會非常棘手針對不同的應用版本。

我會嘗試以下方法:

  1. 在Automator中,選擇腳本的內容,並將其複製到剪貼板。

  2. 打開文本編輯並創建一個新文檔。使用Format > Make Plain Text將新文檔的格式更改爲純文本。然後粘貼剪貼板的內容,以便您擁有AppleScript純文本的備份副本。

  3. 返回Automator並刪除所有運行AppleScript操作的文本。保存Automator文檔。

  4. 保存Automator文檔後,返回到TextEdit,選擇您之前粘貼的所有純文本,並將其複製到剪貼板。

  5. 返回Automator並將純文本粘貼到運行AppleScript操作中。 之前你點擊編譯,確保你已經正確設置了名字,例如「Adobe Photoshop CS6」。編譯時,應該保持Adobe Photoshop CS6而不會恢復到CS4。

如果一切正常,基本上,你在做什麼基本上是強迫的AppleScript(或的Automator)放棄所有的AppleScript的內部/緩存交涉的對象與腳本交易,並重新創建它們從頭開始重新解析文本。

+0

謝謝@NSGod,真的很感謝細節,今天早上我會試試(英國/時差因此延遲..) – LeonardJG

+0

輝煌,謝謝,那修好了。問題解決了。 – LeonardJG