Resize image in PhotoShop CS5

Ok, hopefully my last questions this time and my script will be finished.

I’ve opened an image in PhotoShop CS5 with:
open file ((path to home folder as string) & “Desktop:Ouput:mypdf.pdf”) as PDF with options {class:PDF open options, resolution:200, page:1}

And now I want to resize the image to for example 600 x 400 pixles.
I’ve tried to use the resize method as:
resize image width 400
and
resize image height 600
but nothing happens. Any ideas for me to test?

And when the image is resize I now solved how to save it. But to close the image
close without saving
wont work. How should I close the image and continue to next thing in my script?

Thanks!

Hi Dood,

I have lately written a lot of scripts for Adobe Photoshop CS4, I guess they will also work for CS5. Maybe this snippet gets you in the right direction:


set jpgfilepath to "Macintosh HD:Users:martin:Desktop:test.jpg"
set tifffilepath to "Macintosh HD:Users:martin:Desktop:test.tiff"
set horiscale to 80
set vertscale to 80
set dpires to 304.8

tell application "Adobe Photoshop CS"
	activate
	set ruler units of settings to point units
	open file jpgfilepath showing dialogs never
	set openimg to current document
	resize image openimg width percent (horiscale) height percent (vertscale) resolution dpires	
	change mode openimg to CMYK
	save openimg in file tifffilepath as TIFF with options {class:TIFF save options, byte order:IBM PC, embed color profile:false} appending no extension
	close current document saving no
end tell

Of cousre you will e.g. have to convert “percent (horiscale)” to your pixel values.

Best regards,

Martin