Zotero export translator that generates a zotero://select link to an item in the Zotero library. (First a simple version, as well as a version that displays minimal citation information and stores further details as title text.)

Kyle
2017-03-04T16:45:56Z

zotselect-link.js

| {
| "translatorID":"04623cf0-313c-11df-9aae-0800200c9a66",
| "translatorType":2,
| "label":"ZotSelect Link",
| "creator":"Scott Campbell, Avram Lyon, Nathan Schneider",
| "target":"html",
| "minVersion":"2.0",
| "maxVersion":"",
| "priority":200,
| "inRepository":false,
| "displayOptions":{"exportCharset":"UTF-8"},
| "lastUpdated":"2010-07-19 03:03:00"
| }
|
| function doExport() {
| var item;
| while(item = Zotero.nextItem()) {
| Zotero.write('<a href="zotero://select/items/');
| var library_id = item.libraryID ? item.libraryID : 0;
|
| var titleS = (item.title) ? item.title.replace(/&/g,'&amp;').replace(/"/g,'&quot;') : "(no title)";
| var pubTitleS = (item.publicationTitle) ? item.publicationTitle.replace(/&/g,'&amp;').replace(/"/g,'&quot;') : "";
| if (!pubTitleS && item.type)
| pubTitleS = '['+item.type+']';
| Zotero.write(library_id+'_'+item.key+'" title="'+titleS+'&#13;'+((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 += " &amp; " + item.creators[1].lastName;
|
| var date = Zotero.Utilities.strToDate(item.date);
| var dateS = (date.year) ? date.year : item.date;
|
| Zotero.write('(' + creatorsS + ' ' + dateS + ') ');
| }
| }

zotselect-link_simple.js

| {
| "translatorID":"04623cf0-313c-11df-9aae-0800200c9a66",
| "translatorType":2,
| "label":"ZotSelect Link",
| "creator":"Scott Campbell, Avram Lyon",
| "target":"html",
| "minVersion":"2.0",
| "maxVersion":"",
| "priority":200,
| "inRepository":false,
| "displayOptions":{"exportCharset":"UTF-8"},
| "lastUpdated":"2012-07-17 22:27:00"
| }
|
| function doExport() {
| var item;
| while(item = Zotero.nextItem()) {
| Zotero.write("<a href='zotero://select/items/");
| var library_id = item.libraryID ? item.libraryID : 0;
| Zotero.write(library_id+"_"+item.key+"'>");
| Zotero.write(item.creators[0].lastName+". "+item.date+". "+item["title"]+""+"");
| }
| }