AppleScript Image Events

brian d foy
May. 15, 2004 11:38 PM
Permalink

URL: http://www.apple.com/applescript/imageevents/index.html...
Now that I have Panther, I can play around with Image Events. Prior to this, I used Perl to read in an image from my phone, scale it to 320x240, then add a black border around the image.
Now AppleScript makes this really easy. Cobbling together a couple of scripts from the Apple web site, I get the job done in a very Mac like way.
set this_file to choose file
try
tell application "Image Events"
launch
set this_image to open this_file
scale this_image to size 318
pad this_image to dimensions {320, 240}
save this_image with icon
close this_image
end tell
on error error_message
display dialog error_message
end try
Although this script asks me to choose the file through a dialog, Apple also shows examples of automatically choosing every image in a directory, on the desktop, and so on. I want to set up a folder for incoming images for a moblog, then automically run an AppleScript on every new photo before it gets posted to the web.
At some point I also want to use Image Events with watch folder for iPhoto, so when I take screenshots I can automatically convert them from PDF to JPEG. I just wish I could automatically import the images, though.
Still, someone at Apple finally did something did something good for AppleScript.
brian d foy
is a Perl trainer for Stonehenge
Consulting Services and is the publisher of The Perl Review.
Do you use image events?
You must be logged in to the O'Reilly Network to post a comment.
Showing messages 1 through 2 of 2.
-
AppleScript
2004-05-16 12:03:28
pudge
[Reply | View]
|
Showing messages 1 through 2 of 2.
|
Return to weblogs.oreilly.com.
Weblog authors are solely responsible for the content
and accuracy of their weblogs, including opinions they
express, and O'Reilly Media, Inc., disclaims any and
all liabililty for that content, its accuracy, and
opinions it may contain.
This work is licensed under a
Creative Commons License.
|