Hi, in case anyone's interested: I started working a plugin for https://github.com/retorquere/zotero-sync to allow live synchronization (as opposed to export/import) from Zotero to Bookends:
https://github.com/cboulanger/zotero-sync-bookends
I've tried this before a few years back but the recent addition of real dictionary based AppleScripting (Thanks Jon!) and the introduction of Javascript scripting support in MacOS (JXA) has vastly improved development experience and performance. JXA is horribly under-documented and requires a lot of try-and-error, but once I found out how things translated from AppleScript to JXA it was nice to be able to stay in one language only. So if anyone is interested in how to do Bookends Scripting using Javascript, here are some examples:
https://github.com/cboulanger/zotero-sy ... c/index.ts
The library isn't finished yet, but works as a proof-of-concept. Contributors are welcome.
NodeJS library to sync Zotero data with bookends using JXA
-
- Posts: 59
- Joined: Mon Jan 28, 2008 6:18 pm
Re: NodeJS library to sync Zotero data with bookends using JXA
Great, thanks for this. i had previously played with JXA a bit as anything is better than Applescript, using it for one simple script but ultimately was more comfortable sticking to my preferred language Ruby for larger scripts. Having some clear examples of using JXA will be really helpful for future projects ![Cool 8)](./images/smilies/icon_cool.gif)
![Cool 8)](./images/smilies/icon_cool.gif)
-
- Posts: 59
- Joined: Mon Jan 28, 2008 6:18 pm
Re: NodeJS library to sync Zotero data with bookends using JXA
@landol Yes indeed I was also happy to find out that I could avoid AppleScript, but it is sad how little attention JXA seems to be getting from Apple - you almost have to guess everything. Luckily, we now have debugging support with the Safari web inspector, which makes try & error at least bearable.
-
- Posts: 59
- Joined: Mon Jan 28, 2008 6:18 pm
Re: NodeJS library to sync Zotero data with bookends using JXA
The Zotero to Bookends synchronization script now is relatively stable: https://github.com/cboulanger/zotero-sync-bookends
Bookends itself doesn't seem to particularly like being scripted - it sometimes crashes when trying to sync really big libraries (>10.000 items).
Other than that, I am pretty happy to have Bookend's lightening-fast search features to query my Zotero group data.
Bookends itself doesn't seem to particularly like being scripted - it sometimes crashes when trying to sync really big libraries (>10.000 items).
Other than that, I am pretty happy to have Bookend's lightening-fast search features to query my Zotero group data.
Re: NodeJS library to sync Zotero data with bookends using JXA
Crash? Or error message (and app continues to run)? In either case, you can send the log or the stack trace to us @ support@sonysoftware.com
Jon
Sonny Software
Jon
Sonny Software
-
- Posts: 59
- Joined: Mon Jan 28, 2008 6:18 pm
Re: NodeJS library to sync Zotero data with bookends using JXA
Thanks, Jon, I will! It completely crashes and afterwards, all the groups programmatically created with are gone. They can be retrieved by "Flatten Groups List Hierarchy", but are then in some previous state (the script renames the groups often to store the synchronization state - I know that is not how Bookends groups are supposed to be used, but it should be possible in principle).
Code: Select all
libraryWindow.groupItems.push(bookends.GroupItem({name:"new group's name"}));
Re: NodeJS library to sync Zotero data with bookends using JXA
Please send me the crash log.
Jon
Sonny Software
Jon
Sonny Software