Re: how to script resizing in Graphic Converter
Re: how to script resizing in Graphic Converter
- Subject: Re: how to script resizing in Graphic Converter
- From: Michelle Steiner <email@hidden>
- Date: Fri, 6 Jul 2001 08:27:17 -0700
On 7/6/01 6:19 AM, Katherine Richmond <email@hidden>
wrote:
>
Would you please share the script that you use to resize an image? I
>
looked in the GraphicConverter dictionary and saw only a scale command.
>
What I need is a resize to make my thumbnails all 110 pixels wide. Can you
>
help with this?
The scale command actually resizes the picture. So, here's a script that
will do it for you:
property targetwidth : 110
tell application "GraphicConverter"
activate
set currentwindow to window 1
set dimensions to (image dimension of currentwindow)
set scalefactor to my computeRatio(dimensions)
scale currentwindow horizontal scalefactor vertical scalefactor
end tell
to computeRatio(numberToScale)
set originalwidth to item 1 of numberToScale
set scalefactor to targetwidth / originalwidth
return scalefactor
end computeRatio
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------