Page 1 of 1

Feature Request

PostPosted: Tue Sep 11, 2012 4:30 pm
by justinkthornton
I'd love to have pattern matching functionality in contents of a document. I use the contains all the time, but it use it to recognize dates with documents would be great. Like if it contains 07-##-2011, I could use that to have a rule that adds month and year to the filename when I'm scanning old files.

Re: Feature Request

PostPosted: Tue Sep 11, 2012 4:51 pm
by Mr_Noodle
I know it would be nice to have but it's a bit difficult to pull off. For "contains", Hazel is leveraging the Spotlight index which preprocesses so that you can do lookups on individual words. You can't really do general pattern matching with it. Doing pattern matching would requiring scanning the whole file which can bog things down greatly.

You'll need to use a script to do this. I think a_freyer had a script to use "grep" to do this so search around for that. Note also that in order to export tokens to Hazel to use in patterns, you need to do this in AppleScript.