Closed nateclark-ucla closed 2 months ago
I'm trying to get add a postscript to BBT to export a CSL variable from the Extra field. However, any script I add is exported as as the field "postscript": [code]. I've included a short debug script in the debug example I uploaded.
I can't yet reproduce this. I get the simple log message as expected. I don't yet know by what path this could end up as a field "postscript" in the output CSL. Can you send a new log and tick the "include cache" option?
I expect this has to do with the "ae:sql:get: undefined is not a string but a undefined" error
No relation.
K9FUKTI3-euc/6.7.226-7
Resubmitted with cache attached. Thanks!
A debug build will drop here in a few minutes, please install it, export again, and send a new log.
:robot: this is your friendly neighborhood build bot announcing test build 6.7.226.6867 ("logging")
This update may name other issues, but the build just dropped here is for you; it just means problems already fixed in other issues have been folded into the work we are doing here. Install in Zotero by downloading test build 6.7.226.6867, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".
R52FBFKP-euc/6.7.226.6867-7
Can you reset the cache from the BBT preferences (under misc), export again, and send a new log?
K6J9AYUD-apse/6.7.226.6867-7
I don't see the translator running. A new build will drop soon, please generate a new log from that.
:robot: this is your friendly neighborhood build bot announcing test build 6.7.226.6870 ("log translator id")
This update may name other issues, but the build just dropped here is for you; it just means problems already fixed in other issues have been folded into the work we are doing here. Install in Zotero by downloading test build 6.7.226.6870, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".
NW6FZ38F-euc/6.7.226.6870-7
NW6FZ38F-euc
shows the CSL to be
{"id":"11spreadmoderndemocracy_","type":"article-journal","language":"en","source":"Zotero","title":"11. The spread of modern democracy","citation-key":"11spreadmoderndemocracy_"}
before and after the postscript has ran. A new build will drop soon, please generate a new log, but can you also post the actual output you are getting?
:robot: this is your friendly neighborhood build bot announcing test build 6.7.226.6875 ("log final result")
This update may name other issues, but the build just dropped here is for you; it just means problems already fixed in other issues have been folded into the work we are doing here. Install in Zotero by downloading test build 6.7.226.6875, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".
You are exporting as BetterBibTeX JSON
, which is BBTs debug format (and it's also used for automation). You want Better CSL JSON
.
Thanks. I've set the export format to Better CSL JSON, and I don't see the postscript anymore.
But, I've tried adding my actual JS to the scripting section and I'm still not seeing my CSL variable ("GSCC") listed under the "notes" field. JSON attached. Exported Items.json
Here's the script I've added:
if (Translator.BetterBibTeX) { if (this.extraFields && this.extraFields.extra) { let citeCount = this.extraFields.extra.find(field => field.name === 'GSCC'); if (citeCount) { this.add({ name: 'GSCC', value: citeCount.value }); } } }
FYI, my ultimate goal is to get this field to show up in Obsidian using the Zotero Integration plugin.
The script you posted will only do stuff in the Better BibTeX
translator, and .add
is specific to the TeX translators; CSL uses simple object manipulation. You want something like
if (Translator.BetterCSL) {
if (extra.kv.GSCC) csl.GSCC = extra.kv.GSCC
}
listed under the "notes" field.
I am not sure what you mean by this.
listed under the "notes" field.
I am not sure what you mean by this.
In the JSON I see the CSL variable under "note":"GSCC: 0021819 \nmy-note: testing" which includes everything in the Extra field.
I tried the script
if (Translator.BetterCSL) {
if (extra.kv.GSCC) csl.GSCC = extra.kv.GSCC
}
But that's not pulling it out. I looked at your Extra fields doc and the Scripting doc, but I'm lost. Should the code above be enough to pass a new CSL variable that's used in the Extra field?
8HMFT7MM-refs-euc/6.7.226-7
does not contain a line
GSCC: something
so there's nothing to pull out.
But there is an error somewhere. I'll look into it tomorrow.
:robot: this is your friendly neighborhood build bot announcing test build 6.7.226.6896 ("testcase")
This update may name other issues, but the build just dropped here is for you; it just means problems already fixed in other issues have been folded into the work we are doing here. Install in Zotero by downloading test build 6.7.226.6896, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".
This will do it now:
if (Translator.BetterCSL) {
if (extra.raw.gscc) csl.GSCC = extra.raw.gscc
}
the .kv
variables only support equivalents of Zotero fields, the .raw
fields have any colon-separated value in extra
. Variable names are always lowercased.
Thanks! GSCC is showing up in the json export.
Now I need to figure out how to get the Zotero Integration plugin to recognize it. For another day!
Debug log ID
8HMFT7MM-refs-euc/6.7.226-7
What happened?
Hi there. Thanks so much for this terrific plugin! I'm trying to get add a postscript to BBT to export a CSL variable from the Extra field. However, any script I add is exported as as the field "postscript": [code]. I've included a short debug script in the debug example I uploaded.
I expect this has to do with the "ae:sql:get: undefined is not a string but a undefined" error, but I'm a total noob.
Thanks in advance for your guidance!