I’m relatively new to DEVONthink, and am struggling to set up automations to properly handle financial statements.
I’ve been using Hazel to handle this automation for the past 5+ years, and am stuck with reproducing the following workflow using Smart Rules in DEVONthink 3.5:
Automatically OCR all incoming PDFs (no issues; implemented in Global Inbox).
Extract a desired date field from the entire financial statement (e.g. extract 14 May 2020).
Coerce extracted date field into “YYYYMM” format (i.e. 202005).
Ensure PDF contains specific text fields (e.g. name of financial institution, account name).
Rename file using “YYYYMM - Custom File Name.pdf”.
File processed PDF into the right location in the database.
I suppose I can “simplify” the above workflow by “Classifying Document”, but I still need the file name of the PDF to be automatically renamed to “YYYYMM - Custom File Name.pdf” upon ingestion.
I searched the forums, and most workarounds seem to be AppleScript heavy, or they aren’t on DEVONthink 3.5.
Thus, reaching out for some help from the community (note: I’m not a highly technical user).
4. Ensure PDF contains specific text fields (e.g. name of financial institution, account name).
5. Rename file using “YYYYMM - Custom File Name.pdf”.
I don’t see where you’re using these steps, especially Custom File Name.
Here is an example that queries based on the Invoice number (since that’s the only exposed valued). Obviously, you could use “Account No.” and all or part of the actual number.
This would be better explained in Hazel’s context where certain conditions need to be met before the entire automation ran (e.g. the right account number exists in the pdf).
Basically, I wanted to use the extracted date “YYYYMM” from PDF to include it within the new file name “Custom File Name” (e.g. Monthly Bill in example below).
I don’t quite understand your workflow. Do you want to rework in DT3 what you already have in Hazel? What’s the point?
I’m asking because I do something similar (with 3 banks, 2 databases and about 6 accounts):
Download bank statements
possibly OCR them using Hazel & PDFPen
extract account #, date and account statement number
rename file accordingly in Hazel
add tag(s) in Hazel
move the statement to the appropriate database and group in DT3 with a single script
Trying to do this in DT3 seemed more tedious because it is still (though that’s changing) less flexibel regarding the possibilities to rename the document.
What do you try to achieve in DT3 that you’re not already doing in Hazel?
Your choice. I’d rather go with “never change a running system”
As to the placeholders: You have to insert the place holders by right clicking in the text field and then selecting them from the popup menu unter placeholder. See the screenshot. The %…% syntax is apparently not meant to insert placeholders manually into the field.
AH! THANKS FOR THIS!
I finally learnt how to add a placeholder (silly I know)…
I’m motivated to “change a running system” if it’s for the better?
Trying to reduce the dependencies on Hazel + PDFpen, and am highly drawn to document similarity scoring (i.e. classify) in DEVONthink.
Managing file paths manually are quite painful…
Thanks Jim! I finally got it working!
@chrillek, @BLUEFROG, I really appreciate your rapid assistance with this!
Following up on this, do you have any good ideas on how to “trigger” Smart Rules?
Kindly reference my current Smart Rule (mock data used):
Challenge:
My desktop notifications are triggering despite having no .pdfs to action upon in the Global Inbox!
What I’m trying to achieve:
After applying an OCR tag (via another Smart Rule) to all incoming .pdfs, I wanted the above smart rule to trigger so as to rename + file my .pdf in its “rightful place”.
I wanted a simple alert to let me know that the operation is complete (but it’s currently triggering non-stop!).
Hey @alvin did you ever figure this out? I’m in exactly your shoes of wanting to consolidate/simplify my toolchain and do as much in DT as possible and on of those use cases is doing something similar to what you’re doing, i.e extracting data from a file and using it as custom metadata, then also running automation on top.