So, I wake up one day and I find my desktop all cluttered with files from last year. 😓 I was thinking ‘I wish there was a way to archive all this with the click of a button’ — I was like eh… maybe some AppleScript for the rescue? 🤔 But then again, I despise AppleScript, so after a lil bit of procrastination I started Googling. Enter Automator — AppleScript without the Script. 😍
Without any further adieu, let’s see how to archive like a pro!
- Firstly, open Automator, create a Service.
2. Select Folders under Service receives selected and in to Finder. This allows the service to be run on folders on Finder.
3. Search for Create Archive drag and drop it into the workflow. Save as can be same name as input because we’ll be running the script on multiple folders and this avoids naming ambiguity. Where specifies where the archive is saved (I’m gonna save it on the Desktop for now).
4. Now for a test run. Push the Run button and you’ll notice a Warning popup — “This service will not receive input when run inside Automator…” which means that there is no input when you run the service from automator, to fix this we drag and drop the Get Specified Finder Items action above the Create Archive action. Click on the Add… button and add a folder to archive. Click on the Run button now and you can see .zip file on the desktop with the same name as the folder.
5. Rename the archives with date and time to better organize. Drag and drop Rename Finder Items below Create Archive. This action will postfix a date to the archive.
Finally, Remove the Get Specified Finder Items action. Which we only included to test run, now that we’ll be running it on real folders, we don’t need it.
Voilà! It’s done! Now change your archive save location and save the service with an appropriate name (Recommend - Archiver). Now open System Preferences -> Keyboard -> Shortcuts -> Services, Scroll down to Files and Folders, find Archiver and set a shortcut (Recommended - ⌘ ⌥ ⌃ ⇧ A).
Bonus for the more savvy people!
Let’s add a notification to show you’ve archived something.
Firstly, drag and drop the Set Value of Variable action below Create Archive action. Create a new variable called Filename — The name of the file including it’s path is now stored in variable Filename.
Then, use the Display Notification action; place it below Rename Finder Items. Add an appropriate title and message. You can use Filename variable that we ever so smarty set before.
Are you even more savvy? Let’s add a voice to dictate it for you!
Use the Get Specified Text and the Speak Text actions; drop them below Display Notification. Add a bunch of things to it and you’re it done!
Now go archive everything my child, be free!