├── README.md └── zotero-translator-tana-cf.js /README.md: -------------------------------------------------------------------------------- 1 | # Zotero Tana Export 2 | 3 | Steps: 4 | 5 | 1. Move the `zotero-translator-tana-cf.js` file into your `Zotero/Translators/` folder. 6 | 2. Restart Zotero 7 | 3. Open Zotero settings and go to `Export`. 8 | 4. Select `Tana Metadata Export` from the `Item Format` list. 9 | 5. You're ready to go! When you copy an item in Zotero, it will be copied ready to be pasted into Tana! 10 | -------------------------------------------------------------------------------- /zotero-translator-tana-cf.js: -------------------------------------------------------------------------------- 1 | { 2 | "translatorID": "dda092d2-a257-46af-b9a3-2f04a55cb04h", 3 | "translatorType": 2, 4 | "label": "Tana Metadata Export", 5 | "creator": "CortexFutura based on Stian Haklev's, Joel Chan's, and Joshua Hall's work", 6 | "editedBy": "Eneko Uruñuela", 7 | "target": "md", 8 | "minVersion": "2.0", 9 | "maxVersion": "", 10 | "priority": 200, 11 | "inRepository": false, 12 | "lastUpdated": "2023-02-28 - 19:51" 13 | } 14 | 15 | function doExport() { 16 | Zotero.write('%%tana%%\n'); 17 | var item; 18 | while (item = Zotero.nextItem()) { 19 | // ref 20 | Zotero.write('- ' + item.title + ' #paper\n'); 21 | 22 | // Citekey 23 | //Zotero.write(' - citekey:: ' + item.citationKey + '\n'); 24 | // Set citekey 25 | if (item.citationKey !== undefined && item.citationKey !== '') { 26 | // Preferred citation key reference syntax 27 | var citationKeyS = '@' + item.citationKey; 28 | 29 | // Write the citation key 30 | Zotero.write(' - Citation key:: ' + citationKeyS + '\n'); 31 | } 32 | 33 | // Set the author list 34 | if (item.creators !== undefined) { 35 | Zotero.write(' - Author::\n'); 36 | for (author in item.creators) { 37 | if (item.creators[author].firstName !== undefined && item.creators[author].lastName !== undefined) { 38 | // Use the full name of the author. Should be the most common situation 39 | Zotero.write(' - [[' + (item.creators[author].firstName || '') + ' ' + (item.creators[author].lastName + ' #author]]' || '') + '\n'); 40 | } else if (item.creators[author].lastName !== undefined) { 41 | // Only use the last name 42 | Zotero.write(' - [['(item.creators[author].lastName + ' #author]]' || '') + '\n'); 43 | } else { 44 | // Hypothetically impossible unless your DB is inconsistent for some reason 45 | Zotero.write(' - Unknown author'); 46 | } 47 | } 48 | Zotero.write('\n'); 49 | } 50 | 51 | // year 52 | var date = Zotero.Utilities.strToDate(item.date); 53 | var dateS = (date.year) ? date.year : item.date; 54 | Zotero.write(' - Year:: ') 55 | Zotero.write((dateS || '') + '\n') 56 | 57 | // publication 58 | Zotero.write(' - Journal:: ') 59 | Zotero.write((item.publicationTitle || '') + ' #[[journal]]\n') 60 | 61 | // zotero link 62 | var library_id = item.libraryID ? item.libraryID : 0; 63 | var itemLink = 'zotero://select/items/' + library_id + '_' + item.key; 64 | 65 | Zotero.write(' - Zotero link:: ') 66 | Zotero.write('[Zotero Link](' + itemLink + ')\n') 67 | 68 | // url with citation 69 | Zotero.write(' - URL:: ' + (item.url || '') + '\n') 70 | 71 | // Status 72 | Zotero.write(' - Status:: Unread\n') 73 | 74 | // Abstract. Change the \n to a multiline string 75 | Zotero.write(' - Abstract:: ' + (item.abstractNote || '').replace(/\n/g, ' ') + '\n') 76 | } 77 | } 78 | --------------------------------------------------------------------------------