I’ve got a script for Photoshop CS that goes something like:
tell application "Adobe Photoshop CS"
tell current document
resize image height (10 as centimeters) width (15 as centimeters) resolution (300 as number) resample method bicubic
The Photoshop CS2 dictionary entry for the resize command is identical to the Photoshop CS entry, but the resize command above produces files with dimensions smaller than those specified.
Does changing the ruler units to other than pixels make a difference?
Changing ruler units in PS appears to have no effect. Do you mean changing the units in the AppleScript command? If so, the answer is yes and no. Yes, in that changing the units results in a change in the final image size. No, in that it still doesn’t produce the right size. So, for example, if I try to set it to 9" x 6" at dpi, I end up with a document 2.16" x 1.44" at 300dpi.
Specifying pixel dimensions does seem to work correctly so I can work around the problem if need be, but I’d rather understand what’s going wrong here.
I’m sure there must be a simple explanation, but I’m puzzled as to why a script command that appears not to have changed between versions is producing such odd results.
I am seeing the same behavior in CS 2.
Resize image scripts that work perfectly in CS produce images that are incorrectly sized in CS 2. I’ve calculated the difference in size for both picas and inches, and it’s the same: The CS 2 image always is 36 percent the size it’s intended to be. So, if an editor sizes an image to be 77 picas wide, he/she will get back an image that is 27.72 picas. What the heck!!!
I have run into the same problem before and managed to find a work around…
There is a relationship between the margin of error and the resolution that you use and with a bit of messing around you can usually find an equation which gives you the right results as long as your resolution is known… for example, i use the following to resize 300dpi images.
set theSize to (x/1.2*5)
if you put the size you want in the place of x this will work for 300dpi images…
hope this helps
it’s highly recommended for CS2 and CS3 to work only with pixel measures and pixel ruler units to get the wanted result.