Just played with the current beta of MarginNote3. I do like MN3 but it has one major drawback: no useful way to extract the data to be used in other apps like Tinderbox or DevonThink. The current beta version of MN3 introduced AppleScript support and I played around with it to get the annotations out of MN3. It’s not finished and I don’t like AppleScript so much (I miss an associative list type and other stuff) but it seems to be possible solution to get the data out of MN3.
# just a sample to extract the annotations of a single notebook within MarginNote3
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
property dictKey : "title"
property dictKey2 : "id"
set allBooks to getAllNotesBooks(0)
set allBTitles to getAllTitlesFromBooks(allBooks)
set dialogList to {}
repeat with n in allBTitles
set dialogList to dialogList & the title of n
end repeat
set theChosenBook to choose from list dialogList with prompt "Select the notebook:"
set allNotes to getAllNotesFromBookWithName(theChosenBook)
set test to true
on getAllTitlesFromBooks(theBooks)
set titleList to {}
if the length of theBooks > 0 then
repeat with n in theBooks
set singleList to {}
tell application "MarginNote 3"
if title of n ≠ missing value then
set curTitle to title of n
set curID to id of n
set scr to "on run argList
return {|" & dictKey & "|: (item 1 of argList), " & dictKey2 & ": (item 2 of argList)}
end run"
set singleList to (run script scr with parameters {curTitle, curID})
copy singleList to the end of the titleList
end if
end tell
end repeat
end if
return titleList
end getAllTitlesFromBooks
on getAllNotesFromBookWithName(aNoteBook)
# get the notes of the first matching notebook
tell application "MarginNote 3" to activate
tell application "MarginNote 3"
set nbk to item 1 of (search notebook aNoteBook)
set nLst to note ids of nbk
set nLst to fetch dictionaries nLst
end tell
return nLst
end getAllNotesFromBookWithName
on getAllNotesBooks(theType)
# get all notebooks MN3 knows of
tell application "MarginNote 3" to activate
tell application "MarginNote 3"
#set nbks to (search notebook "" with type DocumentNotebook)
if theType = 1 then
#DocumentNotebook
set nbks to search notebook "" type DocumentNotebook
else if theType = 2 then
# CardDeck
set nbks to search notebook "" type CardDeck
else if theType = 3 then
# MindMapNotebook
set nbks to search notebook "" type MindMapNotebook
else
set nbks to search notebook ""
end if
end tell
return nbks
end getAllNotesBooks
The output:
{{title:"Wozu ein Titel?", id:"47B580BC-F1D1-49C2-8DAB-0E7A78E1DF03", notebook:"088EED5B-D2FE-46A6-B4E2-6388C027395A", excerpt text:"Modul G2: Geschichte der Schriftkultur", is mindmap node:false, start page:1, end page:1, start pos:"136.965902,558.762416", end pos:"393.620713,555.655129", color index:0, fill index:-1, comment dictionaries:missing value}, {title:"", id:"68325CEA-B310-42D4-BB3E-E5AFF8DE143B", notebook:"088EED5B-D2FE-46A6-B4E2-6388C027395A", excerpt text:"Gelangt eine entwickelte Schrift von außen in eine orale Gesellschaft, ist sie zuerst nur in begrenzten Bereichen und mit begrenzter Wirkung zu finden. In dieser Übergangszeit werden Schrift und Schreiben oftmals als „Werkzeug von geheimer und magischer Kraft“ gesehen.", is mindmap node:false, start page:3, end page:3, start pos:"73.965705,380.231816", end pos:"242.973411,312.216952", color index:1, fill index:-1, comment dictionaries:missing value},...}