This macro watches a directory and when files are dropped in it does some stuff, asks the user to do some stuff and stuffs it in DevonThink. It uses PDFtk to read and write basic metadata to the PDF; so you will need to install it if you want to use this macro. I had problems reading with Finder (it didn’t read the metadata for newly created files quickly enough.)
It works something like this:
- Check the file has a .pdf extension
- Use PDFtk to dump it’s metadata
- Parse the file’s infoKey/infoValues into a KM variable
- Popup a dialog in which they can be edited (or added.)
- Optionally, and by default, start a non-forking MacVim to make more significant edits
- Write the metadata update to the file with PDFtk
- Re-parse the metadata and check that, at least, the title metadata was set
- Rename the file to the set title
- Add it to a specified DevonThink database and group
- Deletes temporary files and move the trigger file into the trash
I guess it’s pretty complicated and no doubt has room for improvement. Some common error conditions are trapped but I bet I’ve missed some obvious ones. It seems to work for me and I’m tired
The macro github is here.