wdhaines

Select note with AppleScript

4 posts in this topic

I’ve put together an Applescript to create notes from templates. The final step is to select the note that has been imported so that I can type right into it. I can’t for the life of me find a way to do this in the script dictionary. All the selections are read-only. Any ideas?

-- Create a new notebook, import the template file, and show shortcut

tell application "Evernote"

set newNotes to import templatePath to curNotebook with tags

set newNote to item 1 of newNotes

set query string of front window to (("notebook:\"" & curNotebook & "\"" as string) & " tag:\"" & curTime & "\"" & " tag:\"@" & templateName & "\"" as string)

set creation date of newNote to current date

set modification date of newNote to current date

-- SELECT THE NOTE SOMEHOW

end tell

Thanks.

Share this post


Link to post

Indeed, selections are read only. Have you thought about using the "open note window" command?

Share this post


Link to post

Good suggestion. That isn’t exactly what I want; I have no need for the extra window, but it is definitely better than importing the note and having it not be focused.

The ability to affect the selected note, especially in list view would be a great feature to add.

Share this post


Link to post

I'm having this problem too, but it's new.  I don't even think it's Evernote's issue but the new OS.  Even "open note window" opens the window unfocused.  Open note window used to work, but lately it doesn't.

Share this post


Link to post