I’ve got thousands of Mac and iOS screenshots on my iMac, many going back fifteen years, and a few even older. I add to them at a rate of knots too, sometimes as many as a hundred in a month. The problem with screenshots is, of course, there is no useful metadata which you can use to search them, or to sort them into folders.
Having discovered that noodlesoft’s superb Hazel can perform actions on the basis of extended attribute (xattr) content, I have been experimenting with the combination of SearchKeyLite (with SearchKey) and Hazel to organise my screenshots for me.
The first, and most tedious, task is to add suitable metadata to each of the screenshots. I did this in two phases: I set some xattrs, such as the Creator and the start of the Keywords, for all the screenshots using SearchKey first.
All I did was dump a copy of all the screenshots into a single folder, then used SearchKey’s batch feature to add the common xattr content, as shown.
I then dragged and dropped batches of those files onto SearchKeyLite, and gave them informative text in each of the xattrs, particularly the Keywords. As I intend sorting them on the basis of Keyword content, that needs careful thought so that Hazel can retrieve the key text from each set of Keywords. For example, I don’t take as many screenshots in iOS, and want them to be tucked away in their own folder. So each iOS screenshot has the characters " iOS "
inside its Keywords.
I then built my folder system ready to handle the task: one folder into which to put unsorted files for sorting, then a hierarchy of folders to contain the sorted screenshots, such as that for iOS.
I opened the Hazel pane in System Preferences, added the sorting folder to its list of folders at the left, and added the first rule to be applied to that folder.
To set xattr content as the attribute to be used in a condition, I opened the first popup menu containing Name, and scrolled to the bottom for the Other… item.
This brings up a panel with a white background listing all the available extended attributes. In this case, I was after Keywords, as saved by SearchKeyLite.
I then set up a search for matched text, in my case keywords such as iOS
sandwiched between Anything.
The final step is to set up the action on satisfying that condition: in my case, to move the file to one of my sorted folders.
I ended up with four rules to sort my screenshots into four separate folders, according to the text contained within their Keywords xattr.
This is easy to debug interactively, tweaking the rules in Hazel, and adjusting the Keywords xattrs for the files using SearchKeyLite. Once happy that it was working as intended, I threw the first hundred screenshots at the sorting folder, and let Hazel get on with organising them for me.
My screenshots are now tagged with metadata in their xattrs which lets me locate them using Spotlight search. They’re organised into folders, making it much easier for me to browse them when I’m looking for a previous image. And as I add more, provided that I spend a minute or two adding xattrs using SearchKeyLite, I have saved a lot of time when I need to come back to them.