Last active
December 8, 2022 09:55
-
-
Save Verssae/c14f9a603328340c260e818575e6f0bd to your computer and use it in GitHub Desktop.
Zotero Quick Copy Link (open-pdf)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"translatorID":"a1c456df-0eea-4fb6-8267-9bfc2c9c793b", | |
"translatorType":2, | |
"label":"Open PDF Quick Copy", | |
"creator": "Hansae Ju", | |
"target":"html", | |
"minVersion":"2.0", | |
"maxVersion":"", | |
"priority":200, | |
"inRepository":false, | |
"displayOptions":{"exportCharset":"UTF-8"}, | |
"lastUpdated": "2022-12-08 10:30" | |
} | |
function doExport() { | |
var item; | |
while(item = Zotero.nextItem()) { | |
// find the pdf in attachements | |
// if there is no pdf, skip | |
var pdf = item.attachments.filter(function(attachment) { | |
return attachment.contentType == 'application/pdf'; | |
}); | |
if (pdf.length == 0) { | |
continue; | |
} | |
// get the pdf key | |
var pdfKey = pdf[0].key; | |
Zotero.write(`zotero://open-pdf/library/items/${pdfKey}`); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment