1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

My first Photoshop Applescript Not Working

Discussion in 'Mac Programming' started by lloyd709, Mar 12, 2009.

  1. macrumors 6502

    #1
    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
     
  2. macrumors 6502

    #2
    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!!
     

Share This Page