Unified script
I wrote a new applescript (zotpick.scpt) to remove the necessity for multiple scripts for output formats and triggering text editor. It is based on the scripts available in this repository and my own work on the now discontinued reference manager Sente (which you can find here). The new script does the following:
- Sets an ordered list of text editors (can be customised by the user)
- Checks if the frontmost app is listed in the above list
- Checks if Zotero is running and if Better BibTeX is installed
- If the frontmost app is among the list of text editors the script proceeds, otherwise it will prompt the user to select a running text editor from the list above as target
- Prompts the user to select an output format from Pandoc, MMD and Scannable cite
- Calls up the Zotero search box
- Copies the selected references in the selected format to the clipboard
- Inserts the formatted reference into the selected text editor.
I have tested the script with Scrivener, TextEdit, Sublime Text, and NVAlt and it works flawlessly.
I have also added a service that utilises this script, which one can then call from within any application and assign a shortcut to through System Preferences.
This is interesting. It's not something I would use, but I can see it being useful.
A question: What's the use-case?
For the other apps you're editing a doc and want to insert a citation. This app in contrast seems to assume the user is not in the WP app, so what are they doing? And what if the desired WP app isn't even running, since they're not actively using it?
I also suspect that most people use one of the formats exclusively, or nearly so, so that having to select the format every time is a pain. That's why the different formats are separated out in the other apps. In other words, while there are multiple apps, it's expected that a typical user is calling just one of them.
Hi, Thanks for asking and sharing your reservations. I see that my preferences might be a bit quirky and rooted in historical practice. I am used to start referencing from within the reference manager and not the text editor/word processor. The script reflects this preference. But it does so without limiting the user to this approach. If you are calling the script with a word processor as the currently active app, it will not ask for a target.
On a more principle level, I am and aim at being agnostic to any one writing programme. I prefer basic markdown for my own writing but use multiple apps for doing so. Yet, whenever I write collaboratively, I will have to use various non-mmd based workflows (be it Microsoft Word, Google docs, Overleaf etc.). The rational behind choosing the target app in the script is twofold: a) As writing apps change, I prefer not to change the referencing workflow and install a new script for every app, for which I would also need to assign a new hotkey. With a universal script, I can call it up from wherever I am. b) I usually want to reference stuff while reading / annotating a PDF. Hence, I can call up this script with the PDF reader in the foreground and then send the citation to a note-taking app.