Thursday, 5 September 2013

Applescript giving error using Evernote's "find notes" verb when application is not open

Applescript giving error using Evernote's "find notes" verb when
application is not open

I'm writing an applescript that interacts with Evernote for Mac using a
command (in the Evernote Suite in Evernote's dictionary) called "find
notes". Here's my script:
tell application "Evernote"
set myNotes to find notes ("intitle:Title")
end tell
It works just fine if I run the script when Evernote is already open, but
if Evernote is not already open when I run the script it gives me an
error: "Expected end of line but found identifier." The word "notes" in
the second line is highlighted.
It behaves the same whether I run it from AppleScript Editor or as a shell
osascript.
It seems to be parsing "find" as a complete verb instead of just part of
the verb "find notes". But if Evernote is open then it recognizes the full
verb and works correctly.
Is there any way to make this work as a script (not compiled) running in
an environment where Evernote is installed but may or may not be running?

No comments:

Post a Comment