doonyakka 2 Posted August 5, 2017 Share Posted August 5, 2017 I regularly need to modify ENML and XHTML files to fix poorly formatted clipped notes (increasingly so since EN 6.11), which means having to manually find the folder for the relevant note (cf. needle/haystack). I know that it's possible to access the EN data folder via [OPT]-Help > Troubleshooting > Open Database Folder, but I was hoping something like this was possible for individual notes too, via AppleScript or some other hack. Any help appreciated. Link to comment
Level 5* DTLow 5,735 Posted August 5, 2017 Level 5* Share Posted August 5, 2017 On 2017-08-05 at 3:29 AM, doonyakka said: I know that it's possible to access the EN data folder via [OPT]-Help > Troubleshooting > Open Database Folder, but I was hoping something like this was possible for individual notes too, via AppleScript or some other hack. Nice to see another user crazy enough to work with the raw files For the uninformed, on Macs there is a folder for each note all the note files are sitting there and can be accessed. The image shows the files for one of my notes Here's my applescript to identify the note folder The database folder is hardcoded Uses sql to access the sqlite database (select ...... ) --Identify the Note Guid tell application "Evernote" set theSelection to get selection set theNote to item 1 of theSelection set theLink to note link of theNoteend tell set AppleScript's text item delimiters to "/"set parsedList to text items of theLinkset noteGUID to item 7 of parsedList --Retrieve the Note Folder from the database set targetDatabaseFolder to "/Users/david/Library/Application/.../www.evernote.com/1156250/"set targetDatabaseFile to targetDatabaseFolder & "LocalNoteStore.sqlite"set sqlText to "SELECT ZLOCALUUID FROM ZenNote where ZGUID = '" & noteGUID & "';"set localFolder to text items of (do shell script "sqlite3 " & quote & targetDatabaseFile & quote & " " & quote & sqlText & quote)set localFolder to targetDatabaseFolder & "content/" & localFolder tell application "Finder" to open folder localFolder as POSIX file Link to comment
doonyakka 2 Posted August 6, 2017 Author Share Posted August 6, 2017 16 hours ago, DTLow said: Here's my applescript to identify the note folder The database folder is hardcoded Uses sql to access the sqlite database (select ...... ) Wow...that's really cool and works perfectly! Thanks so much! :-) Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.