New Scripts for MarginNote4

Hi,

MarginNote has finally brought out a long-awaited new major version and released MarginNote 4. It’s great!

Since the old Hookmark scripts no longer worked, I’ve created a very simple replacement based on UI scripting. It seems to work without issues in my testing.

Get Name

try
    tell application "System Events" to tell process "MarginNote 4"
        delay 0.1

        click menu item "Copy Card Clone" of menu "Card" of menu bar 1
        delay 0.1
        set clipboardContent to the clipboard
    end tell
    
    -- Retain only the content up to the first line break
    set theURL to paragraph 1 of clipboardContent

    return theURL

on error msg
    display dialog msg
end try

Get Address

try
    tell application "System Events" to tell process "MarginNote 4"
        delay 0.1

        click menu item "Copy Card URL" of menu "Card" of menu bar 1
        delay 0.1
        set clipboardContent to the clipboard
    end tell

set theTitle to the clipboard


    return theTitle

on error msg
    display dialog msg
end try
1 Like

Note that I’ve now modified the “Get Name” script in the original post to include only the title of the card when creating a Hook.

Thank you very much for your scripts, @AW2307 .

The script server has been updated. The version is 327.

Please let us know if there is any problem.

Thank you

1 Like