AppleScript to Export Notes in OPML
Re: AppleScript to Export Notes in OPML
(Hello fellow archaeologist!)
Re: AppleScript to Export Notes in OPML
(Hello there as well!)
"If we knew what it was we were doing, it would not be called research, would it?"
Re: AppleScript to Export Notes in OPML
This script is excellent! Is there a way to preserve any formatting (bold/italics/underline) given to notes from bookends? I use bold/italics to distinguish quotations from my commentary on them. Thanksiandol wrote: ↑Mon May 13, 2019 6:33 pm Updated the gist, although I am likely to keep the bookends-tool source always up-to-date and it is the same script:
https://raw.githubusercontent.com/iando ... pplescript
Re: AppleScript to Export Notes in OPML
The applescript interface returns text without any formatting (this script uses the older event system, but the newer dictionary also returns text). I suppose there may be a possibility to create a custom format including the note field, and return it as formatted text like HTML, I tested it and bold text in a note does make it to the output...
but the next question would be the best way to encode it in the OPML, and whether whatever reads the OPML would understand it. I personally don't have time to edit this script.
One other solution would be if Bookends could convert its formatting (which I assume is RTF encoded?), to markdown when accessing individual itemsso at least the formatting would be plain text yet readable to other applications.
Code: Select all
tell application "Bookends"
set myRefs to selected publication items of front library window
set rtfRefs to format myRefs using "Printout.fmt" as HTML
end tell
One other solution would be if Bookends could convert its formatting (which I assume is RTF encoded?), to markdown when accessing individual itemsso at least the formatting would be plain text yet readable to other applications.
Re: AppleScript to Export Notes in OPML
Thanks iandol, much appreciated. I have no scripting expertise so I think I'll have to admit defeat there. I'm no going to try to figure out whether there's a way to get paragraph breaks within single bookends notecards as an alternative way to distinguish between quotes and commentary.
Re: AppleScript to Export Notes in OPML
I've now found out, courtesy of Jon, how to make multi-paragraph notecards (double returns initiate a new notecard, so separate any returns with a space to keep them within a single notecard). So this provides me with a way to differentiate quotes and my commentary instead of bold/italics.iandol wrote: ↑Mon Mar 22, 2021 9:18 pm The applescript interface returns text without any formatting (this script uses the older event system, but the newer dictionary also returns text). I suppose there may be a possibility to create a custom format including the note field, and return it as formatted text like HTML, I tested it and bold text in a note does make it to the output...
This leads me to ask if it's possible for your script to enable these within-single-notecard paragraph separations to be reflected in the notes as they appear in scrivener? I just tried it out and they are not currently. Thanks in advance and sorry to pester.
Re: AppleScript to Export Notes in OPML
As far as I can tell, Notes are already split into separate cards (look at the raw OPML to see), and Scrivener imports them as children of the OPML document:
At the moment the title is not parsed, this could be added by using markdown headers?
At the moment the title is not parsed, this could be added by using markdown headers?
Re: AppleScript to Export Notes in OPML
Actually, headers are parsed if formatted correctly:
Bookends: Scrivener:
Bookends: Scrivener: