Cropping an Image

I would like to do something like this:

crop this_image to dimensions {(docWidth-120), (docHeight-120)}

But, this returns an error. How do I simply crop the image minue 120 pixels on each side?

launch photoshop, select the select tool, command shift i then delete

j/k
I dont know if you can do it with out scripting an app, not sure though
:? :?

Maybe try Image Events.

I haven’t tried Image Events yet myself, but have a look.

The following mostly lifted from Apple’s website:
http://www.apple.com/applescript/imageevents/03.html

Try:


set this_file to choose file
try
tell application "Image Events"
launch
set this_image to open this_file
set {docWidth, docHeight} to the dimensions of this_image
crop this_image to dimensions {docWidth-120, docHeight-120}
save this_image with icon
close this_image
end tell
on error error_message
display dialog error_message
end try

This will crop 60 pixels from the top, bottom, left and right.

Kevin

ktam, that was it. it works great thanks!

now, do you know how to add a stroke in the same mannor?

this is what i’ve found so far:


tell application "Adobe Photoshop CS"
     stroke this_image width {4} location {inside}
end tell

it gives me some weird error. can you have a tell within a tell?