a blog
by John D. Muccigrosso
It’s been a while now since the last major Zotero upgrade (to version 7). It brought lots of nice things, but also broke Zotfile, a handy extension for managing the files (mostly PDFs) associated with entries. This post is about my attempt to replace the one feature I really missed.
I keep the files (mostly PDFs) associated with Zotero entries on my laptop—which of course is backed up in a couple of ways. However I often like to read and annotate those files on my iPad. Zotfile made it fairly easy to manage this by making a copy of the local file in a place where my iPad could access it and then moving that copy back to local storage when I asked it to. In my case this meant moving the file to a folder in my iCloud storage area which is accessible from all my devices. I was really missing this, so I decided to work up an AppleScript solution and put it into a Quick Action with Automator.
Now Zotero doesn’t have an AppleScript dictionary, so I have to work directly with the files. I might be able to do something with Zotero’s javascript capabilities, but this was an easier lift.
The basic steps are fairly simple:
I do a copy in step 1 because I want to hold onto a backup and a move in step 2 so that I don’t leave a copy behind that might confuse me into thinking that I had forgotten about it.
Of course the details are a little more complex. For one thing, I want to be able to deal with either copy of the file, the local version or the iCloud one. Here then are the more detailed steps for the Quick Action which appears in the contextual (right/control-click) menu:
Along the way, I do a bunch of error checking. For example, I don’t want to apply this to files that aren’t in my Zotero storage locations; I don’t want to overwrite a file that already been copied to iCloud; and so on.
Finally the script gets put into an Automator workflow. There I use the standard Automator template to “receive the current file” and feed it to the AppleScript. The start of the Quick Action looks like this in Automator:
I’ve been using this for a few weeks now and so far, so good. I do need to get to the file in the Finder either via Zotero’s “Show in Finder” function or by going directly to the iCloud folder, but that’s not a big deal. I’ll probably get around to making things a little more robust, as I noted above, but I’m pretty happy with the way it’s going.
Here’s the script in my GitHub repo. You’ll have to tweak the path for yourself, so I’m not including the Automator file.
If you’re looking to replace the ability to quickly add and manage files in Zotero, I find the Attanger utility useful.