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

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

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
AbwehrchefVC
 
Posts: 8
Joined: Sun Jan 08, 2017 9:46 am

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

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.
AbwehrchefVC
 
Posts: 8
Joined: Sun Jan 08, 2017 9:46 am

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


Return to Support

cron