2016-06-22 21 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