OK, my journey with JXA continues. I need some help/guidance from you JS/JXZ gurus to figure out how to get an Evernote Note object reference from this.
TIA for your help. Sorry if this is obvious – still learning JXA.
###Results of JXA Script
app = Application("Evernote")
app.findNotes("tag:testTag")
--> [app.notebooks.byName("Inbox").notes.byId("x-coredata://13D7F9EC-B91A-40C9-966F-CB023FD546CB/ENNote/p1858"),
app.notebooks.byName("Inbox").notes.byId("x-coredata://13D7F9EC-B91A-40C9-966F-CB023FD546CB/ENNote/p1857"), app.notebooks.byName("Inbox").notes.byId("x-coredata://13D7F9EC-B91A-40C9-966F-CB023FD546CB/ENNote/p9")]
I believe this is the actual ref I need:
byId("x-coredata://13D7F9EC-B91A-40C9-966F-CB023FD546CB/ENNote/p1858")
###Here’s the full script:
var noteList = []
var oNote
var strNoteTitle
appEN = Application('Evernote');
appEN.includeStandardAdditions = true
var noteList = appEN.findNotes("tag:testTag");
var numNotes = noteList.length;
console.log(numNotes);
oNote = noteList[0]
console.log(oNote)
strNoteTitle = oNote.title
console.log("Title: " + strNoteTitle);
###For comparison, here is the AppleScript version that works fine:
tell application "Evernote"
set noteList to find notes "tag:testTag"
set numNotes to count noteList
log numNotes
repeat with oNote in noteList
set strTitle to title of oNote
log strTitle
end repeat
end tell -- Evernote
RESULTS:
(*3*)
(*TEST #2 for Script Search*)
(*TEST for Script Search*)
(*TEST Table of Contents Master Note -- ACCT-2*)