File rename auto-date

Posted:
Fri Jan 01, 2010 10:24 pm
by indros
I want to use Hazel to automatically rename bank statements that I get via email or download. What I'd like is to do a format like this:
Bank 2009-12.pdf
I can have Hazel tag it with the date downloaded, but sometimes I download the file a few days after the relevant month. Is there a way to have it do [BANK NAME] [YEAR] [MONTH - 1] ?
For example, backdate a file downloaded in February 2009 to be 2009-01?
Re: File rename auto-date

Posted:
Sun Jan 03, 2010 12:57 pm
by Mr_Noodle
How do the files look when you first download them? Hazel can't use dates if it doesn't have access to them. If you download a statement a month late, what information is there in the file for Hazel to glean to know that the statement was actually for a previous month?
For the case where you download the statements in the same month (i.e. the date added/modified/created corresponds roughly with the statement date), you can set up a rename pattern like:
(domain) (date created)(extension)
The (domain) attribute matches the domain you downloaded it from. This usually matches the name of the institution/bank. You can click on it and see extra options to strip off the www and .com from it. The nice thing about doing it this way is that it works if you have multiple banks you download from (like I do).
As for the date, click on it to edit its format. There, you can make it 2009-01 or whatever. Unfortunately, as I noted above, you can't do any math there so you have to find a real date associated with the file that matches with "the month before".