We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I found this note template by the Better Notes author: #49 (comment)
${await new Promise(async (r) => { async function getAnnotation(item) { try { if (!item || !item.isAnnotation()) { return null; } let json = await Zotero.Annotations.toJSON(item); json.id = item.key; delete json.key; for (let key in json) { json[key] = json[key] || ""; } json.tags = json.tags || []; return json; } catch (e) { Zotero.logError(e); return null; } } async function getAnnotationsByColor(_item, color) { const annots = _item .getAnnotations() .filter((_annot) => _annot.annotationColor === color); let annotations = []; for (let annot of annots) { const annotJson = await getAnnotation(annot); annotJson.attachmentItemID = _item.id; annotations.push(annotJson); } const editor = await Zotero.Knowledge4Zotero.knowledge.getWorkspaceEditorInstance(); await editor.importImages(annotations); return Zotero.EditorInstanceUtilities.serializeAnnotations(annotations); } const attachments = Zotero.Items.get(topItem.getAttachments()).filter((i) => i.isPDFAttachment() ); let res = ""; let colorYellow = "#ffd400"; let colorRed = "#ff6666"; let colorGreen = "#5fb236"; let colorBlue = "#2ea8e5"; let colorPerple = "#a28ae5"; for (let attachment of attachments) { res += `<h2><p style="background-color:${colorYellow};">Yellow Heading</p></h2> ${(await getAnnotationsByColor(attachment, colorYellow)).html} `; res += `<h2><p style="background-color:${colorRed };">Red Heading</p></h2> ${(await getAnnotationsByColor(attachment, colorRed )).html} `; res += `<h2><p style="background-color:${colorGreen };">Green Heading</p></h2> ${(await getAnnotationsByColor(attachment, colorGreen )).html} `; res += `<h2><p style="background-color:${colorBlue };">Blue Heading</p></h2> ${(await getAnnotationsByColor(attachment, colorBlue )).html} `; res += `<h2><p style="background-color:${colorPerple };">Perple Heading</p></h2> ${(await getAnnotationsByColor(attachment, colorPerple )).html} `; } r(res); })}
I entered it in Tools -> Developer -> Run Javascript, but I am getting error "SyntaxError: unexpected token: '{'"
I use Zotero ver. 6.0.30 and BetterNotes ver. 1.0.4 (latest for Zotero 6).
Am I doing something wrong? Do I need to paste the code somewhere else?
SyntaxError: unexpected token: '{'
No response
The text was updated successfully, but these errors were encountered:
I found an answer in another thread. Would it be possible to edit the template in #227 to:
I have no idea how to do it myself, so I am asking kindly!
Sorry, something went wrong.
windingwind
No branches or pull requests
Is there an existing issue for this?
Are you using the latest Zotero and the latest plugin?
Environment
Describe the bug
I found this note template by the Better Notes author: #49 (comment)
I entered it in Tools -> Developer -> Run Javascript, but I am getting error "SyntaxError: unexpected token: '{'"
I use Zotero ver. 6.0.30 and BetterNotes ver. 1.0.4 (latest for Zotero 6).
Am I doing something wrong? Do I need to paste the code somewhere else?
Debug Output
SyntaxError: unexpected token: '{'
Anything else?
No response
The text was updated successfully, but these errors were encountered: