On Feb 6, 2006, at 1:38 PM, David A. Cox wrote:
But I get a type error every time I try to do something like scale the image, or even save it as a new file using Image Events. A failing example:
tell application "Image Events"
scale favicon by factor 2
end tell
Does anyone have any advice on how to make the downloaded image more useful?
For one thing, you have to open the image in Image Events.
Here is a sample:
set H_width to 640
set V_width to 480
set the photo to choose file
tell application "Image Events"
launch
set the selected_image to open the photo
set dims to dimensions of the selected_image
if item 1 of dims is greater than item 2 of dims then
if item 1 of dims is greater than H_width then
scale the selected_image to size H_width
else
scale the selected_image to size V_width
end if
save the selected_image in the photo
close the selected_image
end if
end tell
-- Michelle
--
"There's some good in the world, Mr. Frodo, and it's worth fighting for."