Automation - Archiving Pocket Articles to DevonThink

Those good folks that develop the Pocket Read-it-later service have today launched a Premium service, whereby subscribers are able to permanently archive the content on a web link (even if the link is subsequently removed at a later point in time) and to allow for full searching of archived content. Currently, searching is restricted to the URL and Title of the article, so this is a definite benefit, and one that almost had me reaching for the Credit Card (OK, 1Password) and signing up. 

Then the sensible side of me came to the fore, which it has been known to do on occasion, and started to assess what current tools I have that may be able to do the same job. I thought of Evernote in the first instance. I'm a Premium Subscriber and I use the heck out of Evernote, that's for sure. It forms a core part of my automation workflows for note taking, but I don't use it for the permanent archive of documents. This role belongs to DEVONthink. 

Now I have the Pro Office version of DEVONthink which means I have a made a financial investment in the product and, if there is a way that I can utilise it better, then I will try to find a way of doing so. Fortunately, I realised today that a lot of this automation is starting to become second nature to me because I had the fix for this sorted in around ten minutes, which for me is pretty good!

1) Use IFTTT to Export Pocket Articles to PDF

Job number 1 is to use our faithful servant IFTTT (If This Then That). You can use the application via the website or download the iOS App. My screenshots below are from the website version. 

I was strapped for time, so I wanted to see if there was a recipe someone had already created for this and, like always, yes there was (The IFTTT community is amazing and I'm very proud to be a part of it). See below:

So to summarise what is happening above, as soon as I favourite an article in Pocket, then the article is going to be converted to a PDF file and sent to a folder in my DropBox account called DEVONthink Auto OCR and Delete. That's quite cool, but it's what happens when it hit's that folder which is where the magic happens.

2) Use an AppleScript to Auto OCR and Delete the PDF

Firstly, in order to get to where we are above, I had to create a folder in Dropbox called DEVONthink Auto OCR and Delete. This folder is going to have an AppleScript assigned to it which was downloaded from the DEVONthink Application (In the top menu bar, click the Scripts icon, then select More scripts and browse for the DEVONthink - Import, OCR and Delete .scpt file)

In order to attach the script to this folder, right click on the folder and select Services. Then choose Folder Actions Setup

Above you will see the completed action, however to further explain. On the left hand side, you can add/remove folders that currently have AppleScripts attached and you can enable/disable them from running via the tick box. On the right hand side, you select the script that is to be assigned. If you wish to add a script, then click on the + button and select the script you wish to assign. The script I have there will automatically Import the pdf into my DEVONthink Inbox, create an OCR'd version and then delete the original. 

So now, I'm done! All I have to do is favourite an article in Pocket by clicking the star and, if my laptop is on, within 30 seconds a fully searchable PDF copy of this article is sitting in my DEVONthink database ready for filing accordingly. By using replication folders in the DEVONthink database and using DEVONthink to Go on my iOS devices, I have them on the go as well. That makes me happy.