Any way to copy only an item's user number and ID?

Hello,

I have been using the Scannable Cites Quickcopy since I write primarily in Scrivener. However, I'm considering shifting to using Zotpress on my website for published articles, and am trying to find the quickest way to Cite the proper format for it as I go.

I have been looking into the various quickcopy options, but unless I’m missing something, I'm not finding a way to copy just the portion of the scannable cite that's after the zu: (the userID:itemID string).

If I could even find a way to copy just the item ID, I can easily append my user ID and a colon with some scripting.

For reference, the zotpress format I'm using would be the following (I've used #'s to stand in for my user ID:

[zotpress items="{#######:27M8HCZ9}" style="chicago-fullnote-bibliography" target="new"]

If I can find a way to easily copy the item ID (ideally the whole string after the zu: of scannable cites), I can then add the {} around it with a script on my clipboard, and, for citations with multiple sources, just paste that portion after the first {} set.

If I’ve missed a way to do this., I apologize. Also, if I need to better clarify, please let me know.

Many thanks!
  • (note that your user id isn't secret; it's visible when you post in the forum, e.g.)

    There is no built in way to do this, but it'd be pretty easy to add a custom export that does. It could even include the Zotpress part.
    If you know a little bit of coding (it's javascript, but as long as you've coded in any language that should do) you can probably figure out to modify the Scannable Cite translator yourself to do that:
    https://github.com/Juris-M/zotero-odf-scan-plugin/blob/master/resource/translators/Scannable Cite.js#L57

    Otherwise you could see if someone would be willing to help you out.
  • Thank you for the reply. I didn't know if user IDS were not supposed to be posted or not, so erred on the side of caution :)

    I've worked with AppleScript and some very basic other scripts, but am still very lost with Javascript. The link jumped me to a particular section, so I'm assuming that's the one I'd need to change.

    If I were able to find help with making the js, how would I even add it to a QuickCopy option? I currently use Zutilo to be able to have multiple quickcopy options with different keyboard shortcuts. I could keep those for the current 3 ptions, and use the custom js for Zotero's default QuickCopy function and shortcut.

    I did look on the Export preferences and didn't see an option for adding one.

    Thank you again for your time.
  • Once an export translator is installed, it automatically appears as an Export option under Export -->default format in the preferences
  • Apologies for being dense, but how is a translator installed? I searched the Documentation and found the page for developers going over the javascript structures, but didn't see how to install it. It's possible I missed it, though.
  • Update: I muddled my way through discovering the Translator Editor, though I think I didn't do the Directory choice correctly. Oddly Scannable Cite, while in my directory, didn't show on the "Load" list within the Translator Editor.

    But I just pasted it into the Code tab and edited in there. I’ve likely left code not needed, but was able to find and replace portions to achieve the needed behavior when copying a single citation.

    However, if I have selected more than one, it copies them back-to-back like with Scannable cites, which each having its own "whole" thing, like:

    [zotpress items="{3198488:27MDHCZ4}" style="chicago-fullnote-bibliography" target="new"][zotpress items="{3198488:GWW92AAE}" style="chicago-fullnote-bibliography" target="new"]

    Is there any translator or documentation for how to tell it to, when more than one is selected, do this behavior:

    [zotpress items="{3198488:27MDHCZ4},{3198488:GWW92AAE}" style="chicago-fullnote-bibliography" target="new"]

    Many thanks again for your time.
  • (The translator editor wasn't really designed with export translators in mind, which is why they don't show up, but glad it (kind of) worked for you.)

    I think what you want is possible, but a much more significant rewrite of the translator.
    The basic idea would be to define a prefix, with which every export starts (everything to the first quotation mark), then define a suffix, with which every exports end (everything from the 2nd quotation mark) and then have the translator write the items in curly brackets and concatenate them with a comma.

    If you want to keep exploring, some of the XML exports translators might be helpful as models, but this is definitely a more ambitious project.
  • Thank you for your input on this. I'm sure my js file looks ridiculous :) I kind of found a way to get what I'm needing, just with a small additional step.

    I changed the export js to just put out the {3198488:27MDHCZ4}. If I select multiple it does:

    {3198488:8WT2MJCZ}{3198488:27MDHCZ4}{3198488:TWCYP5VQ} as I wasn't sure how to do what you're describing with a separator of sorts.

    So, I added a "second step" where after copying that to the clipboard from my Quickcopy, I hit a 2nd keyboard shortcut that runs an Applescript I wrote, which adds comma separation and then the Zoftile prefix and suffix bits, all "unseen" on the clipboard so I can then paste:

    [zotpress items="{3198488:8WT2MJCZ},{3198488:27MDHCZ4},{3198488:TWCYP5VQ}" style="chicago-fullnote-bibliography" target="new"]

    Not the most elegant, but it will do :)

    Than you again for your help!
  • Cool. Functionality >>>> Form
Sign In or Register to comment.