MacTech AppleScript Essentials Column > Performing Basic Image Manipulation… Using Your Existing Software

March, 2005 - Performing Basic Image Manipulation... Using Your Existing Software.

This month, we're going to talk about performing some basic image manipulations with AppleScript. With the onset of the digital camera revolution comes a new set of problems for the computer user. The first thing many people realize after purchasing a digital camera is that film is essentially free, as is developing. You can take as many pictures as you like, just as long as you have ample hard drive space to store them.

While this concept seems amazing at first, you quickly realize that you now have thousands and thousands of image files to deal with. Those image files need to be downloaded, imported, renamed, filed, rotated, cropped, converted to other formats, and more! Sure, there are some tools that Apple gives us to help with these tasks, such as Image Capture and iPhoto. There are also a slew of other applications that you can download or purchase to aid with processing. However, wouldn't it be great if you could slap a few lines of code together to write your own application in order to help with your unique process? Well, using AppleScript, you can.

AppleScript is the perfect tool for automating many image-related tasks. As we have discussed in previous articles, AppleScript can be used to batch-rename files and folders. So, you could create a script that downloads your digital images into a custom folder structure and renames the images with the current date. You could create a script that opens up a folder of images in something like Photoshop and adds copyright information into the images' metadata. The possibilities are virtually limitless.

For this particular article, we're going to focus on performing some basic image manipulations, such as cropping, rotating, and resizing. We'll also look at ways you can convert your images to other formats, such as from JPEG to TIFF, and vice versa. Since AppleScript alone cannot manipulate images, you may be asking how will we do this? Using a background application named Image Events, which comes installed with Mac OS X, version 10.3 and higher, we can perform these tasks. [Read more at MacTech.com...]