PDA

View Full Version : My first Photoshop Applescript Not Working




lloyd709
Mar 12, 2009, 07:36 PM
I've just started to learn Applescript and wrote the following script to try and get Photoshop to adjust an image and save it under a new name in the same directory. However, on running the script it adjusts the image OK but leaves me with a 'save as' screen with the file name the same as the old file. I've looked up many example save scripts and seem to be following the syntax correctly (but clearly not). The problem is with the save command. Any ideas where I'm going wrong?

tell application "Adobe Photoshop CS4"
open {file "Jobs:Live:Page2_3.PSD"}
resize canvas of the current document width 40.3 height 30 anchor position middle left
save current document in file "Jobs:Live:webPage.jpg" as JPEG
end tell



lloyd709
Mar 13, 2009, 12:37 PM
I've worked out what the problem was - I simply needed to flatten the image first. Photoshop couldn't save the file as a JPG as it had layers!!