Last active
November 15, 2020 06:38
-
-
Save Benature/5e04ef4a3ba85d9c6fc123c0d68f5823 to your computer and use it in GitHub Desktop.
Zotero url cheme
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":"BA3A62C2-E8B8-11E3-8533-A664DDBCE621", | |
"translatorType":2, | |
"label":"Modified ZotSelect Link", | |
"creator":"Max Masnick, based on work of Scott Campbell, Avram Lyon, and Nathan Schneider", | |
"target":"html", | |
"minVersion":"2.0", | |
"maxVersion":"", | |
"priority":200, | |
"inRepository":false, | |
"displayOptions":{"exportCharset":"UTF-8"}, | |
"lastUpdated":"2014-05-31 03:03:00" | |
} | |
function doExport() { | |
var item; | |
var count = 0; | |
var scheme; | |
while(item = Zotero.nextItem()) { | |
// scheme = 'zotero://select/items/'; | |
var library_id = item.libraryID ? item.libraryID : 0; | |
var titleS = (item.title) ? item.title : "(no title)"; | |
var pubTitleS = (item.publicationTitle) ? item.publicationTitle : ""; | |
if (!pubTitleS && item.type){ | |
pubTitleS = '[' + item.type + ']'; | |
} | |
// scheme += library_id+'_'+item.key+' - '+titleS+' - '+((item.conferenceName) ? item.conferenceName : pubTitleS); | |
var creatorsS = item.creators[0].lastName; | |
if (item.creators.length>2) | |
creatorsS += " et al."; | |
else if (item.creators.length==2) | |
creatorsS += " & " + item.creators[1].lastName; | |
var date = Zotero.Utilities.strToDate(item.date); | |
var dateS = (date.year) ? date.year : item.date; | |
// scheme += ' (' + creatorsS + ' ' + dateS + ")"; | |
// scheme.replace(/ /g, '%20') | |
scheme = "[" + titleS + "](zotero://select/items/" + library_id + '_' + item.key + ")\n"; | |
Zotero.write(scheme); | |
if (count > 0) { | |
Zotero.write("\n"); | |
} | |
count++; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Zotero url cheme when Command+Shift+C in
[title](url)
format, which is modified from masnick