Support inquiry: MarginNote

Curiously enough, that second JavaScript draft now seems to be working fine from Hook on my system …

Perhaps worth trying on other systems too …

(It’s a combined Name and Address script – try leaving the Name script empty, and pasting the code linked to below in the Address script panel)

1 Like

That works, many thanks @RobTrew :grinning_face_with_smiling_eyes:

1 Like

Scripts bundle 84 contains the Margin Note updates. Than you @RobTrew and @stevelw ! 1.3 coming up …

1 Like

Hi! What do I need to be doing in MarginNote for Hook (1.4) not to say “No linkable item found in MarginNote 3”?

It’s working here, and assuming that you have the latest copy of the scripts,

e.g. Preferences > Updates > Check now in English-language macOS installation,

then my first guess is (if your installation is not using any variety of Anglo Saxon as the UI language) that the problem is rooted in the use of GUI scripting, and an assumption, in the Hook script for MarginNote, of English-language labels for menu items:

So, for example, in the Preferences > Scripts entry for your version of MarginNote, where you will find two scripts:

  • Get Name
  • Get Address

You could, in the short term, edit the two scripts so that Anglo-Saxon menu path labels like:

  • Edit > Copy

  • Edit > Copy Note URL

are replaced by locally more relevant terms.

More generally, I’m not sure whether the makers of Hook have developed an approach to localisation issues in these scripts yet.

Thanks for the detailed answer, @RobTrew!

image

If capitalization is important, I see “note” differs from “Note”.

Apart from that, I realize my issue might be related to my using SetApp’s version of MN3.
I could take a look at the other scripts in Hook where two different scripts are provided, one for non-SetApp, one for SetApp version of the same app.

Thanks again!

Nope. I use SetApp’s instance of MN3 and it works great with Hook.

I’m going to post (again) this likely culprit, which seems to bedevil other Hook users:

Replace “Chrome” with “MarginNote”/

Thanks; you’ve eliminated two possible causes but I’ve still got the issue.
Now I know that SetApp’s MN is supported, and I confirm that all the automation privacy checkboxes are checked, incuding Hook’s request for control of MarginNote. :confused:

Sorry the interaction with MarginNote is not working for you, @danieljomphe. I’ve asked our MarginNote interaction dev to look into this.

@danieljomphe , Bi Ling here wrote to me saying

It works fine on my machine.

One thing that I noticed that is when select a node, it can’t be in an edit mode. If in edit mode, “Copy note url” menu item is disabled. Hook would not work

Can you please ask him to give us a screen shot with Hook window on a select note? Also before invoke Hook window, ask him to check Edit ->Copy Note URL is enabled or not. That might give us some clue.

You got it. I thought opening a document was sufficient.
I knew I was missing something - that’s why I asked “What do I need to be doing…” initially. :slight_smile:
So my intention was to have a document link, but deep-linking might be even more useful. Thanks!

1 Like

Thanks for persisting with this and bringing it up. Deep linking in as many apps as possible is definitely an important direction.

I’ve just started using MarginNote 3. I can link to extracted highlights/notes, but when I try to link to the document itself, I get no linkable items found. Not a very big deal as I can link to it via Trickster or Finder, but it seems odd to be able to do deep linking (wonderful!) but not the top-level linking.

In other words, ‘hooks’ in MarginNote are all “deep” (to the item selected when Copy Link or Hook to Copied Link is called), with no reflection of the document structure at this point.

Does MarginNote enable you to copy ta link to the entire document? (In my exploration of the app I couldn’t see that). If so you could use Hook to Copied Link on the other side, if that helps.

No. That’s what I can’t make work.

I’m not sure I quite understand. If you mean starting with the other file I want to link to the MarginNote document and copying its Hook link, then invoking Hook in MarginNote to paste the link, that doesn’t work either. I can only create links to/from the entire document in Finder.

Yes – provided the document has a “Study Notebook” associated with it. in the “Study” view, select the notebook for the document and chose “Copy notebook URL” from the contextual menu.

This is essentially an “indirect” link to the document, but it serves the purpose pretty well and is usable in Hook of course.

Be safe.

Katie

Hi! A quick note to mention that MarginNote 3.7.8 added AppleScript support, and here’s the documentation I could find.

3 Likes

About time! This is good news.

Hello,

Any news about the integration between Hook and Margin Note 3 ?

danieljomphe is right, the update surely solves the problem!

Get Address:

on theSplit(theString, theDelimiter)
	set oldDelimiters to AppleScript's text item delimiters
	set AppleScript's text item delimiters to theDelimiter
	set theArray to every text item of theString
	set AppleScript's text item delimiters to oldDelimiters
	return theArray
end theSplit

tell application "MarginNote 3"
	set n to item 2 of my theSplit(name of window 1, "MarginNote 3 - ")
	set id_ to id of item 1 of (search notebook n)
end tell
return "[" & n & "](marginnote3app://notebook/" & id_ & ")"