Evernote applescript api giving Result: missing value when trying to create note with file

StackOverflow https://stackoverflow.com/questions/18133019

  •  24-06-2022
  •  | 
  •  

Question

I'm trying to run this simple applescript code and am running into the Result: missing value error

tell application "Evernote" to create note title "Note 3" from file "/Users/nicholasromano/Downloads/hi.sql" notebook "AppleScriptNotebook2"

The file exists, any ideas?

Edit: I also tried using the HFS path: "Macintosh HD:Users:nicholasromano:Downloads:hi.sql" but that returned the same error.

Was it helpful?

Solution

Checkout this guide to AppleScript and POSIX paths. This worked for me:

set posixPath to "/Users/someone/Downloads/test.txt"
set thePath to POSIX file posixPath

set theTitle to "Sample Title"
set theNotebook to "Inbox"

tell application "Evernote"
    set theNote to create note title theTitle from file thePath notebook theNotebook
end tell
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top