Hi I am trying to write an applescript to crop images. As an example, I have a 300 (width) x 200 (height) image and I want to resize it 120 x 60.
There is a “crop” command in the Applescript dictionary of Photoshop CS2 which has the following explanation:
crop document : the document object or objects to be operated upon
bounds list : area to crop (unit value)
[angle real] : angle of cropping bounds ( default: 0.0 )
[width real] : width of resulting document (unit value)
[height real] : height of resulting document (unit value)
I put in a command in my Applescript as follows
[i]set docHeight to height
set docWidth to width
set newdocHeight to 60
set newdocWidth to 120
set variable1 to (docHeight - newdocHeight) / 2
set variable2 to (docWidth - newdocWidth) / 2
set variable3 to newdocHeight
set variable4 to newdocWidth
crop docRef bounds {variable1, variable2, variable3, variable4}}[/i]
But this produces an image 30 x 10 (not 120 x 60 which is what I want)!!
If anyone out there could give me some advice it would be much appreciated - thanks!
Bis