I often receive inquiries concerning ways to automatically pull a date from the text of a PDF document and insert it into the file name. This has, to some degree, become a Arthurian quest to automate file naming and use accurate dates. Since I first released Paperless, I’ve had several readers send in suggestions that involved very complex AppleScripts, multiple Hazel rules, and other devices that never quite seem to work.
Today, Paul Kim released Hazel version 3.1. The new version includes an improved content matching feature to include dates. This seemingly benign feature is anything but. It allows you to search the contents of a document for date formatted text. You can even set the type of date format you’re looking for. For instance 6/19/13 or June 19, 2013.
If Hazel finds a date, it will then retain that date and save it, in essence, as a variable. You can then apply that variable later to the file. In this case, I’m going to use the date in the file name. Hazel even corrects the date format, converting the slashes to dashes. It’s like magic. This new feature got me so excited, I made a short video explaining how to do it. My thanks to Johnny Knittle for providing the music.
Hazel 3.1 from David Sparks on Vimeo.