Windows
Control Evernote from the command line
Overview
You can build applications that integrate with Evernote for Windows by passing command line options to the Evernote.exe and ENScript.exe executables.
Locating the Executables
To invoke one of the executables, Evernote's program directory must be in your shell "Path", or you must give the full path to the executable when you invoke the command. For developers building applications that work with Evernote, it's best to give the full path, which you can find using the Windows App Paths functionality described below. You should never hardcode the path to the Evernote installation.
Version 4.0 and later of Evernote for Windows registers the installation path of ENScript.exe and Evernote.exe with the Windows App Paths system. Many Windows applications and functions automatically look at App Paths when searching for an executable name. You can also manually look up the path in the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\ENScript.exe or HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Evernote.exe. The fully qualified path to the application, including name of the executable, is found in the (Default) registry subkey, while the path to the application without the name of the executable is found in the Path registry subkey.
Evernote.exe
You can invoke Evernote.exe with the commands described below. Note that individual commands cannot be combined. If Evernote is already running, your command will be passed to the existing instance.
[filename]
If you pass the full path to a file, a new note is created. If you pass a .txt, .htm or .html file, the file contents are used as the new note's content. If you pass a .enex file, the Evernote note(s) that it contains are imported. If you pass a .url file, the hyperlink is used as the new note's content. If you pass any other file type, it is attached to the new note.
/NewNote
Opens a new window with a new, empty note. Equivalent to right-clicking on the Evernote icon in the taskbar and choosing "New note". This command was added in Evernote for Windows version 3.5.
/NewInkNote
Opens a new window with a new, empty ink note. This command was added in Evernote for Windows version 3.5.
/NewWebCamNote
Opens a new window that allows the user to capture a new web cam note. This command was added in Evernote for Windows version 3.5.
/Task:ClipScreen
Invokes Evernote's screenshot clipper, which allows the user to take a screenshot of the desired portion of their screen and save it in a new note. Equivalent to right-clicking on the Evernote icon in the taskbar and choosing "Clip screenshot". This command was added in Evernote for Windows version 4.0.
/Task:PasteClipboard
Creates a new note containing the contents of the clipboard. Equivalent to right-clicking on the Evernote icon in the taskbar and choosing "Paste clipboard". If the clipboard contains text or HTML, or a .txt, .htm or .html file, it is used as the new note's content. If the clipboard contains a .enex file, the Evernote note(s) that it contains are imported. If the clipboard contains a .url file, the hyperlink is used as the new note's content. If the clipboard contains any other type of file, it is attached to the new note. This command was added in Evernote for Windows version 4.0.
/Task:SyncDatabase
Causes Evernote for Windows to synchronize with the Evernote service. Equivalent to right-clicking on the Evernote icon in the taskbar and choosing "Sync". This command was added in Evernote for Windows version 4.0.
ENScript.exe
You can invoke ENScript.exe with the commands described below. Note that individual commands cannot be combined. Some of the scriptable functionality in ENScript.exe overlaps with that in Evernote.exe.
ENScript.exe is available in version 3.0 and later of Evernote for Windows.
Common flags
In addition to the options listed below, each ENScript.exe command accepts the following options that specify the Evernote account to access. None of these options are required:
- /u username - The username for the account to access, if not the same as the database filename.
- /p password - The password for the account to access, if not saved within Evernote for Windows.
- /d filename - The database filename if the username is not specified.
createNote
Create a new note with the following options:
- /s filename - Specifies a file containing the note's plain text contents. If omitted, the note contents are read from standard input.
- /n notebook - Specifies the name of the notebook to create the note in. If the notebook does not exist, it is created.
- /i title - Specifies the title of the note.
- /t tag - Specifies the name of a tag to apply to the note. If the tag does not exist, it is created. You can repeat this flag to add multiple tags.
- /a filename - Specifies a file to attach to the note. You can repeat this flag to attach multiple files.
- /c date - Specifies the note creation date and time using the format "YYYY/MM/DD hh:mm:ss". If omitted, the current time is used.
importNotes
Import one or more notes from an Evernote export file (ENEX):
- /s [filename | url] - Specifies a file containing an ENEX to import, or a URL from which an ENEX can be retrieved. If omitted, the ENEX is read from standard input.
- /n notebook - Specifies the name of the notebook to create the note(s) in. If the notebook does not exist, it is created.
showNotes
Set the current note list view to the results of a query:
- /q query - Specifies the query to run. The query string is formatted according to the search grammar. To show all notes, use "/q any:"
printNotes
Print a set of notes:
- /q query - Specifies the query that selects the notes to be printed. The query string is formatted according to the search grammar. To show all notes, use "/q any:"
exportNotes
Export the set of notes to an Evernote export file (ENEX):
- /q query - Specifies the query that selects the notes to be exported. The query string is formatted according to the search grammar. To show all notes, use "/q any:"
- /f filename - Specifies the name of the file to export the notes to. If omitted, the ENEX is written to standard output.
createNotebook
Create a new notebook:
- /n notebook - Specifies the name of the notebook. If omitted, the name is read from standard input.
- /t [local | synced] - Specifies whether the new notebook is a local or synchronized notebook. If omitted, a synchronized notebook is created.
listNotebooks
Lists existing notebooks:
- /t [local | synced] - Specifies whether local or synchronized notebooks are listed. If omitted, all notebooks are listed.
syncDatabase
Causes Evernote for Windows to synchronize with the Evernote service:
- /l filename - Specifies the name of a file to write log messages to. If omitted, log messages are written to standard output.