Shortcuts/Workflows for using Zotero on iPad

I posted this in a reply, but thought maybe it could be useful to make it more obvious. If anyone wants to use Zotero on iPad, I put together some workflows using the iOS shortcuts app and the Zotero API. I have more of these too, so please let me know if you have something specific you need, I might have already built something.
  • Thank you so much! This is fantastic.
  • My pleasure, I hope people find them useful.
  • This is awesome, thank you for putting it together! Is there a way to not use a collection key - to search through one’s entire library instead of limiting it to one collection?
  • Welcome. There should be a way to do that. I will have a play around and post a reply. I also have another version to post that extracts Better BibTeX keys, so I will add them at the same time. Give me a couple days.
  • Ok, it turns out the change is very simple. I will have the update posted soon, but If you want to access your full library in the meantime you can edit your own shortcut easily enough. I recommend duplicating the workflow first, in case you accidentally break something (trust me its easy to do).

    All you need to do is edit the URL field (it comes after 'URL encode', and before 'Get contents of URL')

    1. Delete this part from the URL: '/collections/CollectionKey/'
    2. The first part of the URL should now look like:

    Any questions let me know. I will have the update done by the end of the weekend.
  • That’s awesome - that worked perfectly! Thank you so much for sharing.

    I look forward to trying the version with Better BibTeX keys, too. And I appreciate both your work on this and your willingness to help.
  • This is so great, but I was wondering if there is a way to have this formatted to include websites as well?
  • What do you mean by “websites”?
  • When Zotero generates a citation from a website it normally includes the url as part of the citation. When I use the shortcut the url is left out.
  • @dstillman Is it possible to use the API to emulate checking the "Include URL in paper articles" preference (I assume that the behavior described by justsade is that?)?
  • The shortcut doesn’t really use the API in quite such a programmatic way. It is making a call to your library and getting the record in a JSON dictionary (or a formatted reference). It iterates through the records and does some crude RegEx to format the in-text citations. Whether or not the URL is included is either down to the citation style, or for the cite as you write citations I’ll have to add a condition to check for that key in the dictionary. It could be messy — or it could work.

    However, it would be helpful if the request was more precise. Are you you’re referring to the bibliography shortcut? Or are your expecting the URL in-text? What style are you using? When you say it generates a citation, do you mean the desktop client?

    If its in the bibliography you just need to add the style you need to the style dictionary. Have a look for the dictionary action in the shortcut that has the CSL styles, you can add as many as you like. If you cant work out how, let me know what style you need and I will add it.

    If it’s in-text, as I say, that will require more work. I can’t say when I might be able to do that.

    My best advice would be make a copy of the shortcuts, then have a to have a look at the API documentation and see if you can make it work for you. I’m not a developer, and I have managed to hack something together... honestly, they could all be improved. But they are there to be adapted if you want to give it a shot. I’m also happy to help if you get stuck hacking. Some communal work on these can only help.

    I still have some updates to post, I will look at posting a quick how-to on making simple changes to the shortcuts.

  • edited February 13, 2019
    @jbpyn is there a way to modify the Cite as You Write shortcut to search, then copy not the short citation but the footnote reference? I only need one style--Chicago full note
  • edited February 14, 2019
    Try this one:

    Please let me know if it does what you want. Feel free to email me via the contact details on my site: (see the icons in the left hand menu). I have been working on a single shortcut to combine many of these functions, I'm on a tight deadline at the moment, but once I clear some time I will finish it and post it to the site.
  • @jbpyn Many thanks! It does what I want after I modified to include the entire db in the search according to your instructions above. I’d prefer the note rather than bibliographic reference but it looks like Zotero API only offers the bibliography option. That will work fine for my purposes for now. I will contact you separately with more feedback since you’ll be working on this further.
  • Cool, definitely do that. I’ll have a look at extracting the note when I have a chance. I haven’t tried using atom yet, it might be an option. Consider this a workaround for the moment.
  • edited February 16, 2019
    I’d prefer the note rather than bibliographic reference but it looks like Zotero API only offers the bibliography option.
    The API supports both 'citation' and 'bib' options. 'citation' should give you the note (the same as Cmd-Shift-A instead of Cmd-Shift-C with Quick Copy in Zotero).
  • edited February 16, 2019
    @dstillman @jbpyn - thanks! when I run a query with format=json&include=citation

    Instead of

    Eleonory Gilburd, <\i>To See Paris and Die: The Soviet Lives of Western Culture<\/i> (Cambridge, Massachusetts: Belknap Press, 2018).

    I get

    {"library":{"id":40,"links":{"alternate":{"type":"text\/html","href":"https:\/\/\/erazlogo"}},"type":"user","name":"erazlogo"},"links":{"alternate":{"type":"text\/html","href":"https:\/\/\/erazlogo\/items\/S7ZLF2WJ"},"self":{"type":"application\/json","href":"https:\/\/\/users\/40\/items\/S7ZLF2WJ"}},"key":"S7ZLF2WJ","meta":{"creatorSummary":"Gilburd","parsedDate":"2018","numChildren":0},"citation":"Gilburd, <\i>To See Paris and Die<\/i>.<\/span>","version":10959}

    From this I infer that “citation”=short reference, not a full footnote, which is fine—it still works way better than a bibliographic reference for my purposes. I’m guessing I need to process the output somehow to extract the short reference from the string. [Edit: found tutorials online & working on this. Exciting!]
  • Yep, that's because the format is JSON. You need to process the dictionary, if you have a look at one of my other Zotero shortcuts for bibliography or cite as you write, you will see examples of how to process the json dictionary.

    I'm happy to sort it for you, but it's awesome learning this stuff and having a problem like this to solve is the best way. If I solve it I will be robbing you! If you get stuck, please do feel free to email me. Once you have it working the way you want it, we can add it to the consolidated shortcuts on my site (with the appropriate credit for your work of course)

  • @erazlogo also, when debugging the shortcut put a 'quick look action' ahead of anything you are having trouble with, and a copy to clipboard action behind it. That will help, for example, when you get a json dictionary. It can be tricky o see what level you're trying to get to in the dictionary, but you can copy the text and paste it into a JSON parser like this:

    Once the JSON is readable you can see what key you're trying to extract. In this case you are trying to get the 'citation' key.

    There is also an incredibly useful action in shortcuts called 'view content graph'. If the data is not being returned as you expect it to, drop that action into the shortcut and it will allow you to look through the raw data.

    Ps. I believe I have worked out the solution for this now, so just say the word and I will post it. But to reiterate my point above, I never really started to get the hang of this stuff until I had a problem I wanted to solve.
  • edited February 18, 2019
    @jbpyn Many thanks for your help! I was able to create several shortcuts that find and copy formatted references from Zotero on iOS—feel free to post them on your site. Here they are, in case anyone wants to use or troubleshoot them.

    Note: the shortcuts for Word work on all three apps. But in Ulysses you’d need an extra step to paste (paste as rich text) and Bear creates more complex formatting for pasted URLs than necessary—to avoid these side-effects I created separate shortcuts for each app.

    Copy short citation (almost Cmd-Shif-A in Zotero)

    Copy bibliographic citation (Cmd-Shift-C in Zotero)

    Note: the bibliography shortcuts don’t seem to work with Cyrillic script, but should be ok with English.

    If anyone happens to use these and has a problem, please let me know on this thread.
  • edited February 18, 2019
    Ok, if anyone can tell me how to covert this string back into Cyrillic that I can display in Shortcuts, either with a regex expression or shortcuts action, please let me know. In shortcuts the code gets displayed, not the Cyrillic.

    <i>III &#x41A;&#x438;&#x43D;&#x43E;&#x444;&#x435;&#x441;&#x442;&#x438;&#x432;&#x430;&#x43B;&#x44C; &#x421;&#x442;&#x440;&#x430;&#x43D; &#x410;&#x437;&#x438;&#x438; &#x438; &#x410;&#x444;&#x440;&#x438;&#x43A;&#x438; &#x432; &#x422;&#x430;&#x448;&#x43A;&#x435;&#x43D;&#x442;&#x435; [1974]--&#x41E;&#x442;&#x43A;&#x43B;&#x438;&#x43A;&#x438; &#x417;&#x430;&#x440;&#x443;&#x431;&#x435;&#x436;. &#x41F;&#x440;&#x435;&#x441;&#x441;&#x44B;</i>. &#x41C;&#x43E;&#x441;&#x43A;&#x432;&#x430;: &#x421;&#x43E;&#x44E;&#x437; &#x43A;&#x438;&#x43D;&#x435;&#x43C;&#x430;&#x442;&#x43E;&#x433;&#x440;&#x430;&#x444;&#x438;&#x441;&#x442;&#x43E;&#x432; &#x421;&#x421;&#x421;&#x420;, &#x41A;&#x43E;&#x43C;&#x438;&#x441;&#x441;&#x438;&#x44F; &#x43F;&#x43E; &#x43C;&#x435;&#x436;&#x434;&#x443;&#x43D;&#x430;&#x440;&#x43E;&#x434;&#x43D;&#x44B;&#x43C; &#x441;&#x432;&#x44F;&#x437;&#x44F;&#x43C;, 1975.
  • Those are the "HTML entities" for the Cyrillic characters (see that by copying the text you pasted into the box here: Whatever programming language you are working in should have a function to convert HTML entities to their text characters.
  • @bwiernik Thanks! I found a way to convert.
  • Hello, I’m a slow learner and new with Shortcuts. I use Zotero a lot with Mac Word. I’d like to use my iPad to write research papers. Would you be able to share a video demonstrating stepwise instructions on using Zotero for citing and referencing on IPad? Thank you for your help in this.
  • Thanks, I tried those instructions. Hard to understand, sorry.
  • Hey @jbpyn after a fair bit of messing around I managed to get the Zotero Shortcut working on my iPad. I tried to buy you a coffee today and the page said you need to choose a payment mechanism before I can submit.
  • Hello @jpbyn and @erazlogo. I’ve repeatedly tried to download the Shortcuts Cite While You Write and followed stepwise instructions but in the end, the created shortcut does not do the job. Instead, I receive this when I do a search: ‘Not found.’
    Alternatively do you know of any reference management software for IPad? Thanks.
  • Hi, I downloaded the cite as you write shortcut on my iPad and I put all the info it asked. However, it keeps giving me invalid key when I run it. I don’t know what I'm doing wrong. Can someone please help?
  • @jpbyn have you guys at all noticed that the choose from list only shows a tiny selection menu for reach citation? I don’t get the full bar as I use to....
Sign In or Register to comment.