Page 1 of 1

rename files with found date into PDF

PostPosted: Sat Dec 12, 2020 8:38 am
by Soc007
Hello,

I search PDFs for the first date found in the file.

With contain mached (Custom Date) and "automatically detect date format" an existing date is not always found.
With an IF query (any condition) I query CustomDate (automatic) or a second CustomDate (its own search format).
Then I set either the Date variable (automatic date search) or the ManDate variable (manual date format).

How can I append the correct variable (Date or ManDate) to the file name on the filename?

Re: rename files with found date into PDF

PostPosted: Sat Dec 12, 2020 10:29 am
by EdBurke
If I've understood you correctly, you have matched the date within the document...right? If so, something like Rename with pattern File Name - *Date Match.pdf should work for you.

Re: rename files with found date into PDF

PostPosted: Sat Dec 12, 2020 12:14 pm
by Soc007
Yes, so far that's true. The only problem is that the automatic date recognition doesn't always work.
some PDFs have a date in the text but are still not recognized.
If I define the date format myself (e.g. dd.mm.yyyy), then the date is found correctly.
Only the automatic recognition of a date format is probably not always possible.

Re: rename files with found date into PDF

PostPosted: Sat Dec 12, 2020 12:47 pm
by Soc007
I found a solution. See that in hazel docu under Reusing Custom Attributes in Condition Patterns.