Skip to content

Instantly share code, notes, and snippets.

@MaggieAppleton
Created January 7, 2025 10:39
Show Gist options
  • Save MaggieAppleton/64ff7fd6e601853ec7151ba9c7cefcfe to your computer and use it in GitHub Desktop.
Save MaggieAppleton/64ff7fd6e601853ec7151ba9c7cefcfe to your computer and use it in GitHub Desktop.
Zotero to Tana Importer (Tana Pate)
{
"translatorID":"dda092d2-a257-46af-b9a3-2f04a55cb04f",
"translatorType":2,
"label":"Tana Metadata Export",
"creator":"Stian Håklev, Joel Chan, Maggie Appleton",
"target":"md",
"minVersion":"2.0",
"maxVersion":"",
"priority":200,
"inRepository":false,
"lastUpdated":"2025-01-07 - 10:15"
}
function doExport() {
Zotero.write('%%tana%%\n');
var item;
while (item = Zotero.nextItem()) {
// Title
Zotero.write('- ' + item.title + ' #[[Academic paper]]\n');
// Authors
Zotero.write(' - Author:: \n');
for (author in item.creators){
Zotero.write(' - [[' + (item.creators[author].firstName||'') + ' ' + (item.creators[author].lastName||'') + ']]\n');
}
Zotero.write('\n');
// Reading status
Zotero.write(' - Reading Status:: Unread\n');
// Year
var date = Zotero.Utilities.strToDate(item.date);
var dateS = (date.year) ? date.year : item.date;
Zotero.write(' - Year:: ')
Zotero.write((dateS||'') + '\n')
// Publication
if (item.publicationTitle) {
Zotero.write(' - Published by:: ')
Zotero.write(item.publicationTitle + ' #Journal\n')
}
// Link
Zotero.write(' - Link:: [' + (item.url||'') + '](' + (item.url||'') + ')\n')
// Abstract
Zotero.write(' - Abstract:: '+ (item.abstractNote || '')+ '\n')
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment