Using Automator and AppleScript to compress a folder full of JPEG files¶
Maybe you have a folder full of JPEG images that you want to re-compress so that they aren't taking up so much room on your disk, or maybe you're delivering them over the web and you don't want to use up all of your bandwidth. If there are tens or hundreds of images, wouldn't it be great to automate the process? You can do this using Automator and Acorn!
Open up the Automator application (it's located in your Applications folder), and make a new Workflow. Next, add a "Get Specified Finder Items" action from the Library on the left of your Automator window. If you need help finding the action, you can quickly search for it in the search field. Use the Add… button on the Finder action to select your images. You can also drag and drop them all into the table.
Now add a "Run AppleScript" action below the Finder action, and paste in the following AppleScript:
Finally, save your workflow. Your workflow should look like this:
You can also download the workflow from here: AcornRecompressJPEGFiles.workflow.zip
Note For App Store Users.
If you've purchased Acorn from the Mac App Store, certain AppleScripts, Automator Actions, and JavaScript scripts may not work for you because of sandboxing restrictions required by Apple. The direct version of Acorn does not have these issues.
Automator Warnings?
If Automator gives you some sort of warning about the Action not working correctly, save your action and try again.