If your anything like me and looking to create an automator workflow that suits your needs when it comes to export and automation then this might just be for you.
This is a workflow automation with MacOs’s Automator and doesn’t require you to have the Automator app open, just save the workflow and quit out of Automator.
I specified the folder where my exports are saved in my case its a HYPE EXPORTS on my desktop. Next, I created a zipped folder nested within HYPE EXPORTS folder, and whatever follows in the sequence of events is in the screenshot.
PS. If you’re wondering why Pause for 30 seconds? I estimated based on the images I have 30 seconds should suffice for imageoptim to run its compression.
Looks good only part is the time delay. Would be the best if ImageOptim could actually be tested for completion of the task. Check out the terminal option that actually allows for blocking (hence waits for completion). Maybe you could add that to your flow instead of the wait… https://imageoptim.com/command-line.html
Make sure you specify the correct path to optimize… you don’t want to optimize your whole Hard drive rather only the files in the exports folder or on a finder selection or on a Hype file dropped on the action
Ok yes I meant to remove the Quit Application. hmm that didn’t seem to work buddy. I changed the pass input to be “as arguments” that too didn’t work. Gear icon is spinning and not really working.
bash/bash opens imageoptim but its no starting the operation.
Actually, you don’t need the *.png in my opinion as we are passing in "$f" being each item added to the watched folder or each dropped item (if used in an Automator program). A regular exports adds a HTML-file and a resource folder. Each is being passed to ImageOptim and I guess ImageOptim ignores the HTML and traverses the Folder.