AppleScript to Export Notes in OPML

Users asking other users for AppleScripts that work with Bookends.
iandol
Posts: 297
Joined: Fri Jan 25, 2008 2:31 pm

Re: AppleScript to Export Notes in OPML

Post by iandol » Wed Aug 09, 2017 10:57 am

OK, no problems to leave it in if it helps some people. I wonder why they misspelled the <iimg> tag?

nickharambee
Posts: 11
Joined: Wed Feb 27, 2019 11:48 am

Re: AppleScript to Export Notes in OPML

Post by nickharambee » Wed Feb 27, 2019 1:38 pm

Hello,

I'm testing out this script for the first time and I am getting an error:

"error "Bookends got an error: Can’t set keywords to false." number -10006 from keywords"

Any ideas what I can do to fix this?

Thanks,

Nick

iandol
Posts: 297
Joined: Fri Jan 25, 2008 2:31 pm

Re: AppleScript to Export Notes in OPML

Post by iandol » Wed Feb 27, 2019 9:33 pm

Which version of BE and the script are you using? I've tested the version in bookends tools (which I trigger with Alfred, but the underlying script is V1.18) and it is working as it used to with BE 13.2.

https://github.com/iandol/bookends-tool ... pplescript

aroddick
Posts: 20
Joined: Tue Aug 29, 2017 1:27 pm

Re: AppleScript to Export Notes in OPML

Post by aroddick » Sat Mar 09, 2019 6:59 pm

I seem to be having the same problem - can't seem to get the notes across to OPML, and will often get the keyword issue. I often also receive a brief message (that pops up for a few seconds) asking if I should "Remove Bookends Header ONLY note cards?"
EDIT: I was successfully using the V1.15 version up until recently (and really enjoying the ease of sending notes over to Devonthink through the OMPL). I did try using the Bookend Tools too, but the notes still don't make their way over to the desktop - just the bibl. info and the abstract.

mjvalente
Posts: 24
Joined: Tue Dec 15, 2015 8:13 am

Re: AppleScript to Export Notes in OPML

Post by mjvalente » Sat May 11, 2019 12:22 pm

Hi,

I have the same problem, but only when the field NOTES has something in it. If the that field is empty, I don't get the error message.

Maybe this will help to track the problem.
"If we knew what it was we were doing, it would not be called research, would it?"

iandol
Posts: 297
Joined: Fri Jan 25, 2008 2:31 pm

Re: AppleScript to Export Notes in OPML

Post by iandol » Sat May 11, 2019 10:11 pm

Hi, my refs have notes and export, can someone create a bookends database with references that fail and when I have time I can have a look.

mjvalente
Posts: 24
Joined: Tue Dec 15, 2015 8:13 am

Re: AppleScript to Export Notes in OPML

Post by mjvalente » Sun May 12, 2019 6:41 am

Here it goes a Library Test (and a screenshot of the error).

Download @ http://pc.cd/pKXotalK

Extra infos:
1. When there's the error message, an opml file is still produced. Strangely, I can import it to most programs, but DEVONthink (DT3 beta 1) does not accept it (no problems with any opml produced with no error).
2. The same problem happens with any opml (from an reference with notes) produced via Bookends Tools via "betoopml" even if no error message appears (i.e. DT3 does not importing the opml file from a reference with notes).
Last edited by mjvalente on Sun May 12, 2019 7:25 am, edited 1 time in total.
"If we knew what it was we were doing, it would not be called research, would it?"

mjvalente
Posts: 24
Joined: Tue Dec 15, 2015 8:13 am

Re: AppleScript to Export Notes in OPML

Post by mjvalente » Sun May 12, 2019 7:12 am

@iandol:

A not real non sequitor request...

In your fantastic Bookends Tools for Alfred would it be possible to include a trigger to copy hypertext link as text?

For instance: beall → select item → some other modifier key → Copy hypertext link as text. Result: bookends://sonnysoftware.com/43066
"If we knew what it was we were doing, it would not be called research, would it?"

iandol
Posts: 297
Joined: Fri Jan 25, 2008 2:31 pm

Re: AppleScript to Export Notes in OPML

Post by iandol » Sun May 12, 2019 8:30 pm

Hi, I've made a small fix to toOPML script so it should now work:

https://github.com/iandol/bookends-tool ... tag/V1.3.2

Regarding copying the backlink, the problem I have is there are no modifier keys left to use! One possible solution is to use a workflow variable so that the behaviour of an existing modifier could be toggled, but it is a bit of a hacky solution. Open an issue on github and we can discuss it there...

mjvalente
Posts: 24
Joined: Tue Dec 15, 2015 8:13 am

Re: AppleScript to Export Notes in OPML

Post by mjvalente » Mon May 13, 2019 6:52 am

Thanks.

Would it be possible to update the BEtoOPML.scpt as well?
"If we knew what it was we were doing, it would not be called research, would it?"

iandol
Posts: 297
Joined: Fri Jan 25, 2008 2:31 pm

Re: AppleScript to Export Notes in OPML

Post by iandol » 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

mjvalente
Posts: 24
Joined: Tue Dec 15, 2015 8:13 am

Re: AppleScript to Export Notes in OPML

Post by mjvalente » Tue May 14, 2019 5:20 am

Interestingly (and unfortunately) the 'notes' field is still producing different outputs.

Here's the end result (after importing the opml file to DEVONthink) of your new updated script (Script to Export Bookends Notes to OPML file v1.18/19) on a reference with SOME text on the notes field:

Image

Now the result with the same script on a reference with NO text on the notes field:

Image

To notice I used the same Bookends' item (#98546). I'm no expert in applescript at all, but some weird behavior re: the notes field is still happening. :(

- - - - - -

@iandol: I have no account on Github, but if you prefer, I can do one and indeed file an issue there.
"If we knew what it was we were doing, it would not be called research, would it?"

iandol
Posts: 297
Joined: Fri Jan 25, 2008 2:31 pm

Re: AppleScript to Export Notes in OPML

Post by iandol » Tue May 14, 2019 7:50 pm

But you are selecting different things in Scrivener in your screenshots, select the containing folder then press ⌘1 to get into Scrivenings mode to see parent and children in one go:
Screenshot 2019-05-15 at 07.43.07_SMALL.png
Screenshot 2019-05-15 at 07.43.07_SMALL.png (37.63 KiB) Viewed 526 times

aroddick
Posts: 20
Joined: Tue Aug 29, 2017 1:27 pm

Re: AppleScript to Export Notes in OPML

Post by aroddick » Wed May 15, 2019 5:21 am

Now works for me...thanks!

mjvalente
Posts: 24
Joined: Tue Dec 15, 2015 8:13 am

Re: AppleScript to Export Notes in OPML

Post by mjvalente » Wed May 15, 2019 3:37 pm

iandol wrote:
Tue May 14, 2019 7:50 pm
But you are selecting different things in Scrivener in your screenshots, select the containing folder then press ⌘1 to get into Scrivenings mode to see parent and children in one go:
Actually what is happening is that DEVONthink 3 (which I was using in the comment above) imports the opml differently from Scrivener:

So, if a Bookends reference is exported via your applescript (or via betooplm) to DT3, what happens is the following:

(1) if the notes field is not with some text = imports correctly; but...
(2) if there's some text in the notes field = the general text itself is placed in the Finder comment area of DT3 and not in the main text.

Example of the 2):

Image

I think I may have to take this issue to the DT3 developers.
"If we knew what it was we were doing, it would not be called research, would it?"

Post Reply