Feature Request

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

Feature Request 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.
justinkthornton
 
Posts: 26
Joined: Wed Aug 03, 2011 11:50 am

Re: Feature Request 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.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Open Discussion