Scaffold test results different from results in production
I want to export the tags that I have for items from Zotero 6.0 to Tana, although I don't think that the destination particularly matters in this case. I have the following code (among a lot of other code) in Scaffold:
"// topics
Zotero.write(" - Topic:: \n");
for (let i = 0; i < item.tags.length; i++) {
Zotero.write(" - [[" + (item.tags[i].tag) + "]]\n");
}"
When I "run do" in Scaffold against a book in my library, the display shows the following results for that code:
" - Topic::
- [[Art]]
- [[Asian]]
- [[Crafts]]
- [[Esthetics]]
- [[Japan]]
- [[Philosophy]]
- [[Theory]]
"
This is the result that I want and was expecting. But, when I save the code (not using Scaffolding since save doesn't appear to work there, but that is another topic) to the translators directory on Windows 10, and then, using the new translator code, export the data for the same book, none of the above output is written. It is as though it just skips the code. All the other data that I am trying to export is written to the export file as I expected.
Anyone have any suggestions about what I am doing wrong and why my test results might not match the production results?
"// topics
Zotero.write(" - Topic:: \n");
for (let i = 0; i < item.tags.length; i++) {
Zotero.write(" - [[" + (item.tags[i].tag) + "]]\n");
}"
When I "run do" in Scaffold against a book in my library, the display shows the following results for that code:
" - Topic::
- [[Art]]
- [[Asian]]
- [[Crafts]]
- [[Esthetics]]
- [[Japan]]
- [[Philosophy]]
- [[Theory]]
"
This is the result that I want and was expecting. But, when I save the code (not using Scaffolding since save doesn't appear to work there, but that is another topic) to the translators directory on Windows 10, and then, using the new translator code, export the data for the same book, none of the above output is written. It is as though it just skips the code. All the other data that I am trying to export is written to the export file as I expected.
Anyone have any suggestions about what I am doing wrong and why my test results might not match the production results?
I forgot that Zotero does not load translators on the fly and that I have to stop and restart Zotero to pick up any changes to the code. Something I knew and then completely forgot for 6 hours today.
(sigh)
Might have been something else?
I know I've had the problem before where I've had to close Zotero and re-start it to see changes I've made to the javascript code of an export translator, but is it every time? In retrospect, I doubt it.
All of the changes to one of the translators would have the same translator ID, since I am just re-saving the same file.
Could it have something to do with whether or not I've used the translator before to export something during the same session? Could it have something to do with having the translator named in the quick-copy preferences?
Zotero.Translators.init()
in the javacript console (https://www.zotero.org/support/dev/client_coding/javascript_api ).It does indeed look like the pre-loading behavior here changed slightly in 6.0
https://groups.google.com/g/zotero-dev/c/7UE3441sug8/m/Hs9mdwJWAQAJ