Resize images with Automator
Resize images with Automator
Mac Tip #280/14-March-2007
A friend recently complained of tedious amounts of time spent resizing photos and screenshots, which led me to explain how Automator can help. I mentioned Automator back in Automate It, Tip #195/11-May-2005.
I have a Finder folder of photos from my digital camera. In my case, each image is 2 or 3 megabytes, and maybe 3,888*2,952 pixels.
If I want to add some of these to my blog they need to be resized to more like 640*480 pixels and a much smaller file size.
Set up the action
Because I only ever work on copies of photos, and never the originals, I first copy the ones I want to resize to another folder and select them.
Set up the Automator workflow
To resize selected photos open Automator (in the Applications folder). In the Library column on the left select Finder. From the Action column in the middle select ‘Get Selected Finder Items’ and drag the action into the large, empty Workflow area on the right.
Next select Preview in the Library column, and drag ‘Scale Images’ from the Actions column to the Workflow area. Make sure it goes below the ‘Get selected Finder Items’ action: actions occur in the order they appear in the workflow.
When you use ‘Scale Images’ an alert will appear asking if you wish to make a copy of the selected items before you change the image files.
I had already made a copy of my files so I chose ‘Don’t Add’, but ‘Add’ is always a safe choice.
After the ‘Scale Images’ action is added to the Workflow, enter the size in pixels of the desired longer side for your resized photos.
View results is a good check
The next step is optional, but useful. Select Automator in the Library column, and drag ‘View Results’ from the Actions column to be the last step in the Workflow.
Run the workflow
Finally, click the Run button. Automator resizes all the selected photos and reports the results in the ‘View Results’ area.
The resulting photos
The photos have been resized and each is now about 100Kb. This is a larger filesize than a dedicated (and expensive) program such as Photoshop would create, but this is a quick and free action.
Many actions are available
There are many other actions you can use, including changing filenames to lowercase, and opening the images in Preview. Explore Automator’s Actions list to find other actions you may wish to add to your workflow.
Save a workflow
If you think you may want to use this workflow again, choose Save from Automator’s File menu and save it to your computer. Tip: make the filename expressive: I called my workflow ‘resize-to-640′. Next time you want to resize a batch of photos in that same way double-click the workflow, select photos in the Finder and click Run in the Automator window.
Download my Resize images workflow here. It’s a 3Kb zipped file, and includes an action to change the filename to lower case: My workflow as a zipped file (3Kb).
Coming soon: more Automator tips.
Popularity: 68% [?]
















Discussion
{ 6 comments… read them below or add one }
I tried both your workflow and my own to resize pictures but I keep getting the same message:
Finder got an error: Can’t get file type of alias “Home:Desktop:Outdoor Photos:IMG_2334.JPG”. (-1728)
I have set the permissions for this folder to enable both read and write but still the same error message.
How did this error come about and how can i resolve it?
Well, 30 seconds of Googling found this:
http://www.macosxhints.com/article.php?story=20051020203919140
“when trying to rename Finder items) I get the following error:
AppleScript Error: Finder got an error: Can’t get properties of alias “user:path:to:file”. (error -1728)
It turns out that if you have FileVault enabled, many Automator actions break when you run them.”
I wonder if that’s your problem?
thanks, works perfectly.
i saved the workflow as a plugin for the finder
so i just gotta right klick the selected images und run the workflow, without starting automator
thanks
Wow! Thank you very much for this explanation. This saves me a lot of time! I sure will start trying to find out what else Automator can do.
@Esteban, how do you make it a plugin for the finder?
hi suzanne,
check out the following screenshots:
http://mt11.quickshareit.com/gallery/view/99e318b0
now you can right-click a folder or images and choose “automator” and your workflow to resize them.
works perfectly
Esteban: many thanks for your handy suggestions. It’s cool that the Automator idea can be even more useful.
Cheers,
Miraz
Start or join a discussion