1
votes

Newbie here.

I'm running a Photo Booth program in Automator. It uses this code to run a photoshop action:


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

However, I have updated the Photoshop version to CS6. However, when I change -tell application "Adobe Photoshop CS4"- to -tell application "Adobe Photoshop CS6"-

...and run the Automator, it instantly switches back to 'CS4' when it runs the Applescript. Why? I'm assuming it must be Automator doing something?

Thanks in advance for any help?

Leonard

1
Have you both versions installed? - vadian
Hi @vadian yes both CS4 and CS6 are installed in Appliactions. - LeonardJG
If you quit CS4 and launch CS6, do you still see it launching CS4? - ThrowBackDewd
Hi @throwbackdewd yes - in fact it opens CS4 even if it is closed.. - LeonardJG
I would recommend quitting your script editor, quitting both versions of Photoshop. Relaunch CS6 and your script editor. Change all references of CS4 to CS6 and try and compile. That should fix your issue. - ThrowBackDewd

1 Answers

0
votes

If I recall correctly, AppleScript scripts will save references to applications like that using alias data, so it can be tricky to target a different application version.

I would try the following:

  1. In Automator, select the contents of the script and copy it to the clipboard.

  2. Open TextEdit and create a new document. Change the Format of the new document to Plain Text using Format > Make Plain Text. Then paste the contents of the clipboard there so you have a backup copy of the plain text of your AppleScript.

  3. Return to Automator and delete all of the text of the Run AppleScript action. Save the Automator document.

  4. After saving the Automator document, return to TextEdit, select all the plain text you previously pasted, and copy it to the clipboard.

  5. Return to Automator and paste the plain text into the Run AppleScript action. Before you hit Compile, make sure you have set the name to the new one properly, i.e. "Adobe Photoshop CS6". When you compile, it should hopefully keep Adobe Photoshop CS6 without reverting back to CS4.

If this works, basically, what you're doing is basically forcing AppleScript (or Automator) to discard all of the internal/cached representations of the AppleScript objects the script deals with, and re-create them by re-parsing in the text from scratch.