![]() ![]() This script replaces evernote:/// link URLs with the corresponding record’s Reference URL. # set (URL of chunk) to (reference URL of rec2) Log message (ref1 as text) & " got to be replaced with " & ((reference URL of rec2) as text) # (iv) replace evernote link with the new one Repeat with rec2 in recs2 # there should be only one record, this line is for debug reasons # (iii) for every record2 formatted note in db that has the given url in its url field Set recs2 to search "kind:formattednote url:" & (ref1 as text) in root of db # (ii) for every link in note pointing towards destination that starts with "evernote://" Set recs to search "kind:formattednote" in root of db # (i) for every formatted note in main db ![]() But I can’t import one huge notebook with standard means, this is why I need all this AppleScript stuff.īTW this is my current version of script ATM: using terms from application "DEVONthink 3" Because notes imported the proposed way (File > Import > Notes from Evernote) have their links already replaced. I wonder how developers of the app did this. Both imported notes will have text starting with evernote:///view/. I’m trying to get all such references to be replaced with Devonthink cross-note links. There are two notes in enex file that can be imported via File > Import > Files and Folders. ![]() I’ve tried a lot of options instead of null but can’t figure out how to test if a chunk of rich text has an active URL property.Īny help to finish this script it will be highly appreciated! On error error_message number error_numberĭisplay alert "DEVONthink 3" message error_message as warningĪn error occurs at the line “if (URL of chunk) is not null then”. # set URL of chunk to reference URL of rec2 Log message ((URL of chunk) as text) & " got to be replaced with " & ((reference URL of rec2) as text) # (iv) check local link of record2 and replace with it the old one # (iii) for every record2 in db if type of record2 is correct Set recs2 to lookup records with URL in current database If exists record with URL (URL of chunk) in current database then If URL of chunk starts with "evernote://" then If (URL of chunk) is not null then # ERROR: Can't get URL of "_my note text without link is here_" Set chunks to attribute run of rich text of rec1 # (ii) if record contains links starting with "evernote://" If ((type of rec1) as text) is "formatted note" then Set recs to a reference to contents of current database # (i) for every record in db check if record is formatted note I’ve tried to write the script myself, and this is what I’ve got so far: using terms from application "DEVONthink 3" I’m a developer myself but I’m not used to apple script dictionary syntax. On my opinion the easiest way to do this is to test whether a record with correct URL is of type “formatted note” (all Evernote imports with text have this type). Thus step (iii) must include an additional mechanism that finds the note with text (not an attachment file). And every child of such group has the same internal Evernote URL in its URL field. Step (iii) has additional complications, because a note with non-image attachments becomes a group consisting of a text note that has the same name as the group and attached files separately. (iv) replace the original reference of the link with the new one. (iii) find another note with text, that has the same URL in URL field and is of type “formatted note” and copy internal link to it, (ii) and if it contains any internal links in text (e.g., links referring to path starting with “evernote://etc”), Thus, all notes imported to the Devonthink no matter which way already do have their own local Evernote link in their URL field embedded. So, I’ve managed to import this one by processing of small chunks of ENEX export packages.īecause internal links are the crucial part of my workflow, I use an apple script to embed Evernote internal links in URL filed of every note. The Devonthink’s embedded import routine handled the most of my notebooks well, yet always get stuck after import of a single huge notebook with a lot of notes. My Evernote flow includes a lot of attachments and internal links across notes. Hello! I’m looking forward Devonthink as a companion to or even the complete replacement of Evernote. ![]()
0 Comments
Leave a Reply. |