One of the things that has always bothered me with a Mac is that screenshots are saved to the desktop by default. Very quickly, the desktop starts getting messy. It would be great if you could save those screenshots somewhere else, or if that’s not possible, monitor the Desktop folder and move them when they appear. In recent versions of the screenshot software, you can in fact, change the default location, but previously we had to lean on one of the little known, but awesome Mac features to automatically move screenshots - Folder Actions. Folder actions allow you to automatically take an action when something happens within a folder. If you just want to see how to change the default screenshot location on a newer Mac, jump to the end of this article. If you want to learn how to use Folder Actions using the screenshot example, read on…
Shortcuts is a newer approach to Automator that does similar things, but wrapped in a more intuitive user interface with pre-built ‘recipes’ of common automations. Shortcuts also embraces more modern usage patterns such as social media integration, and support for iOS devices, but I don’t think it supports folder actions. I encourage you to check out Shortcuts for automating common tasks as well.
Creating a Folder Action
The heart of folder actions lies in the Automator tool included on every Mac. It is a little known tool that allows you to create workflows of various types to automate different tasks. To open Automator, from the Launchpad, open the Other
group and you will find Automator
. Once opened, at the file dialog, select New Document
. Automator then asks what type of document you’re intending to create - select Folder Action
and click the Choose
button.
You’re now presented with the blank Automator canvas. On the left is a library of tools that can be used when creating an Automator workflow, on the right is the working document - currently empty. Unique to the Folder Actions type of Automator workflow is the header…
Change this to the Desktop
folder. This will be the folder that is automatically monitored by the script. Now we can start adding action items to the workflow. There is a massive list of tools available to us, but for this workflow, the only category necessary is the Files & Folders group, so limit the list of tools in the second column by selecting Files & Folders
in the left column under the Library
branch. It’s worth perusing the rest of the available tools just to see what’s possible.
We need to first make sure that the files being added are ones we want to move, and to do that we need to use the filter tool. Drag the Filter Finder Items
onto the canvas.
Replace Any content
with Name
, select begins with
and enter Screen in the text box. This will identify any items that begin with the term ‘Screen’.
Now that we’ve identified the file(s) that need to be moved, we need to tell the system to actually move them. To do this, drag a Move Finder Items
element onto the canvas. It will automatically add a link to the filter step. This indicates that the output of the filter step will be the input to this step - move items. The output of the filter step is all files in the Desktop folder that begin with the text ‘Screen’, so the move tool will move those files.
We do need to tell it where to move them to though. If you haven’t already set up a new folder to store all those screenshots in, now’s the chance. I set up a Screen shots
folder on my desktop, but you could easily place it in your Documents folder or anywhere else for that matter. Once you have a new destination folder set up, change the Desktop
drop down in the Move Finder Items
step to the destination folder - in my case, to Screen shots
.
Save your automation by selecting File
→ Save
from the menu bar and giving it an appropriate name.
Now all that’s left to do is test your new automation. Take a screenshot (Cmd
+Shift
+3
for full screen, Cmd
+Shift
+4
for selection window) and verify that the screenshot is automatically moved to the destination folder, no longer cluttering your Desktop. Note that any existing Screenshot files will also be moved as that filter step will identify all of them.
This is just one example of how you might use the Folder Actions Automator type. It could also be used to fire off an action remotely if, say a Dropbox folder had changes, or if you want to keep a record of changes to a working folder for logging purposes. Essentially, it’s another useful tool in your toolbox, allowing you to automate common tasks.
Where is the workflow stored?
When saving a Folder Action workflow, the save dialog is a little different. This is because it is not a normal file, and instead is saved in a system location, not readily accessible by the user. To get to the file, you need to navigate to the user’s Library
folder, which by default isn’t visible in finder. In Finder, go to the Go
menu in the task bar and hold the Option
key - Library
will become and option allowing you to access the current user’s Library files.
The Folder Action workflows are stored in
~/Library/Workflows/Applications/Folder Actions
How to change the default Screenshot save location
Cmd
+Shift
+5
is the video capture hotkey. Using this key sequence, you’re able to change the options, including the place to store the captures. You don’t need to do a video capture to make the changes take effect - just change the Save to
location from the Options
drop down and then close the floating window (x
on the left, or just press Esc
).