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

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

  •  24-06-2022
  •  | 
  •  

Pregunta

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.

¿Fue útil?

Solución

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
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top