Page 1 of 1
Custom Date problem

Posted:
Sat Jan 07, 2017 10:48 am
by alpatti
I am trying to get a date from a bank statement. What I see on the statement is "to May 21, 2016" and I can create a custom date to match. However, the spacing on the next scanned document may be "toMay21, 2016". Can the spaces be wild carded or is there another solution for getting the date with 1 rule?
Re: Custom Date problem

Posted:
Sun Jan 08, 2017 1:41 am
by alpatti
I stumbled upon nested conditions which I sort of got to work. My nested custom dates were
If any
Contents | contain match | Cdate where Cdate is a custom date
Contents | contain match | Cdate1 where Cdate1 is a variation of custom date
Contents | contain match | Cdate2 where Cdate2 is a variation of custom date
Contents | contain match | Cdate3 where Cdate3 is a variation of custom date
In my test example, Cdate3 matched and the entire rule was met.
With a matched rule I would like to move and rename the file. The move is okay, but now I have a renaming problem.
Rename with pattern Cdate ........pdf
Since Cdate did not match, the date portion of the rename is blank. What now?
Re: Custom Date problem

Posted:
Mon Jan 09, 2017 12:21 pm
by Mr_Noodle
Instead of having separate custom date attributes, you can re-use the same one in each condition, varying the pattern for each. The first one to match is the one that gets used.
Re: Custom Date problem

Posted:
Mon Jan 09, 2017 4:06 pm
by alpatti
When I tried to create another custom date (my name Cdate), Hazel automatically saved it as Cdate 4 (since the Cdate name had already been used?). How can I rename a variable name?
Re: Custom Date problem

Posted:
Tue Jan 10, 2017 11:48 am
by Mr_Noodle
Don't create a new attribute. If you look in the list of attributes you can drag in, you'll see your previous attribute there. Drag that one in and edit it.
Re: Custom Date problem

Posted:
Wed Jan 11, 2017 11:04 am
by alpatti
Thanks, that helps.