Change creation date based on part of file name

I’ve been an Evernote user and am trying out the DEVONThink trial, but I am having a hell of a time working with dates (because DEVONThink uses ‘date’ in its library, it’s impossible to coerce anything into a date in the middle of a ‘tell’ block).

I name my receipt files based on the date, time, and amount of the receipt; for example: ‘2014-01-02 085300 7-Eleven $5.53.pdf’.

I can convert the first 17 characters of the filename using the date format that AppleScript expects (I’ve got that down from doing it for Evernote), but I CANNOT get DevonThink to take this date as the creation date of the record. I’ve tried multiple ways.

The scripts I’ve seen thus far have only updated the date based on a predetermined user-entered date. I need it to update based on information in the FILENAME.

Has anybody figured this out?

Just a quick note: It’s inadvisable to use $ in a filename (amongst other excess punctuation).

You need to use the correct fully-qualified property names. “date”, “modification date”, “creation date”, “addition date”, “opening date” – all of these are different properties. So


set date ...


set creation date ...

Are two different and unrelated commands. It helps to browse the dictionary for DEVONthink in AppleScript Editor or whatever coding environment you are using.