Page 1 of 1

Can the date from the file name be written to the metadata

PostPosted: Fri May 03, 2019 6:24 am
by AbwehrchefVC
Hello,

I use Hazel to rename my PDF´s and then use a script to move it to the different folders in DEVONthink.
This script is very error-prone.

That's why I'm looking for a way to use Hazel to write the date from the filename (which I wrote from the OCR to the filename using various rules) to the metadata. The best date for this is the creation date.

DEVONthink 3 can use this in order to arrange the files in the different folders within DEVONthink using certain "intelligent rules".

I can't use another date, because I want to use the date on the invoice, letter etc..

Is there such a possibility? Maybe via Automator or AppleScript? Then I would be interested in how you can do that.

Thank you very much for your tips

Many greetings
Markus

Re: Can the date from the file name be written to the metada

PostPosted: Fri May 03, 2019 10:36 am
by Mr_Noodle
I've moved your post here as the Forum/Site discussion is about this forum or the site itself.

Which date did you want to write to? Hazel does not have a built-in action to write the date but you can use a shellscript to call the 'touch' command, for instance.

Re: Can the date from the file name be written to the metada

PostPosted: Fri May 03, 2019 11:48 am
by AbwehrchefVC
Mr_Noodle wrote:I've moved your post here as the Forum/Site discussion is about this forum or the site itself.


Ups, sorry :oops:

Mr_Noodle wrote:Which date did you want to write to? Hazel does not have a built-in action to write the date but you can use a shellscript to call the 'touch' command, for instance.


For example:
I rename an incoming invoice either with the help of text expander in:

Foto_Rechnung_2019-05-03_Lieferant_Product.pdf

or Hazel automatically renames the invoice to :

ABC_&_Collegen_Rechnung_2019-05-03 Jahresabschluss.pdf

And this date, which represents the invoice date, is to be written in the metadata in the creation date. Then the invoice should be moved to DEVONthink 3. I can then use this creation date in DEVONthink 3 for further moving.

Re: Can the date from the file name be written to the metada

PostPosted: Mon May 06, 2019 10:46 am
by Mr_Noodle
I'm not sure if the "touch" command can change the creation date but the point still stands that you will need to use an outside tool to do the actually setting of the date. I believe the "SetFile" command, which comes with the developer tools can do that though.