Applescript Application to open and resize images in Photoshop CS5


I need an Applescript Application (a droplet) to drag open images and do the following in Adobe Photoshop CS5

  1. The user will drag the files on the Apple Script Application (No dialogs to appear);
  2. Change the resolution of each image to 300 without re-sampling;
  3. Change the color mode with working CMYK;
  4. save the images as .tiff with default values;
  5. close the files.

Can anyone one help…


try this, the script opens the dropped files in PhotoShop
The files are saved in the same folder as the original files.

on open theFiles
	repeat with aFile in theFiles
		tell application "System Events"
			set {name:fileName, name extension:fileExtension, container:fileContainer} to theFile
			set containerPath to path of fileContainer
		end tell
		set TIFFpath to containerPath & text 1 thru ((get offset of "." & fileExtension in fileName) - 1) of fileName & ".tif"
		tell application "Adobe Photoshop CS6"
			open file (aFile as text)
			tell current document
				change mode to CMYK
				resize image resolution 300.0 resample method none
			end tell
			save current document in TIFFpath as TIFF
			close document 1
		end tell
	end repeat
end open

Hi Stefan,

Thanks for the script, however, I want the application for CS5 not cs6. Secondly, while testing the script in CS6, I got an error “The variable theFile is not defined.”

Apart from this, the source files (images) could be of any type i.e. jpg, png, eps, etc. and most important the file may or may not contain extension. I’m on MAC OS X

Could you please send me the revised code for CS5.

Thanks in advance.

sorry, I wrapped the code in the on open handler and forgot to replace theFile with aFile in the first System Events line.
The script is supposed to handle all file types however there is no error handling for file which Photoshop cannot open.
I don’t have CS 5 but I guess the script works on CS 5 as well

Hi Stefan,

It’s working only on CS6 and also popping up the Profile mismatch Dialog box. I tried to run the script in CS5, but it is not compiling.

Could you please make it to work in CS5.

Thanks in advance.

As I said, I don’t have CS 5 so I cannot test it

Thanks Stefan, Can anyone else provide me the code for CS5.

Hi Everyone,

In addition to my previous request, I’m submitting you the actual Photoshop CS5 Action Droplet that is used to convert images to CMYK with 300 DPI and embedded with colour profile.

Can anyone, please give me the Applescript code with exactly the same actions. I need it urgently and specifically for Adobe Photoshop CS5.

Million thanks in advance.