Search
« Send Web Cam Pictures to Evernote with SnapIT | Main | How to Feed Twitter to FeedBurner »
Saturday
Aug222009

ENScript - Scripting Evernote in Windows

I've spent a little while today looking at putting something together for EverNote.  Hopefully I'll have it finished pretty soon and I'll probably share it with you when it's done, but whilst I've been experimenting, I've also been looking at ENScript a command line utility that allows you to interact with an EverNote database.

The one thing I haven't yet managed to get to grips with is the use of @filename to create a response file.  I just get "Unknown command" or "Can't open Database ... error FILE_NOT_FOUND".  Now this may be due to my set-up, but I get the feeling that it may be something else.  The reason I suggest it could be my set-up is because I actually run the portable version of EverNote and unfortunately ENScript is only deployed in the Windows installer.  So I had to copy it from the installation directory of a machine with the Windows version installed.  In any case even without the use of a response file, you can just make multiple calls so I don't think I've lost out on any functionality ... but if anyone has worked out how to use this please feel free to add a comment and example to this post.

The documentation for ENScript's use is found at the command line (using "enscript /?" and "enscript [command] /?") and I couldn't find a nice expanded list of the documentation so I used a bit of old school command line work and extracted the full set of help to a note in my EverNote database.

... and just in case you would like to experiment with ENScript, you may find this documentation useful too.


Usage: ENScript <command> [options]
Commands:

createNote     - creates note from the specified file path or url
importNotes    - imports notes from the specified export file
showNotes      - displays specified notes in the Evernote window
printNotes     - prints specified notes from the Evernote window
exportNotes    - exports specified notes into a file
createNotebook - creates a notebook
listNotebooks  - lists specified notebooks to standard output
syncDatabase   - synchronizes database to the service

@filename - specifies response file name containing options one per line. Command line options that follow response file name specification override options specified in the response file.

Usage: ENScript createNote [options]
Options:

/s file - file containing the plain text note contents. If omitted, note contents are read from standard input.
/n notebook - notebook to create the note in. If does not exist, lazy create. If omitted, use default notebook.
/i title - specifies note title. If omitted, note title will be generated automatically.
/t tag - specifies note tag. If tag does not exist, lazy create it. Use multiple /t options to specify multiple tags.
/a filename - specifies file attachment. Use multiple /a options to specify multiple file attachments.
/c dttm - note creation date/time. { "YYYY/MM/DD hh:mm:ss" | filetime }. If omitted, use current time.
/u username - user name if not the same as database file name.
/p password - user password to confirm Evernote service access.
/d database - database file name if user name is not specified.

If both database file name and user name are not specified, last login name is used and if there is none, USERNAME environment variable value is used as a user name.

Usage: ENScript importNotes [options]
Options:

/s {file|url} - source .enex file or url. If omitted, stdin is used to gather source specification.
/n notebook - notebook to create the note in. If does not exist, lazy create. If omitted, use default notebook.
/u username - user name if not the same as database file name.
/p password - user password to confirm Evernote service access.
/d database - database file name if user name is not specified.

If both database file name and user name are not specified, last login name is used and if there is none, USERNAME environment variable value is used as a user name.

Usage: ENScript showNotes [options]
Options:

/q query - query to filter the notes. If omitted, stdin is used to gather query specification.
/u username - user name if not the same as database file name.
/p password - user password to confirm Evernote service access.
/d database - database file name if user name is not specified.

If both database file name and user name are not specified, last login name is used and if there is none, USERNAME environment variable value is used as a user name.

Usage: ENScript printNotes [options]
Options:

/q query - query to filter the notes. If omitted, stdin is used to gather query specification.
/u username - user name if not the same as database file name.
/p password - user password to confirm Evernote service access.
/d database - database file name if user name is not specified.

If both database file name and user name are not specified, last login name is used and if there is none, USERNAME environment variable value is used as a user name.

Usage: ENScript exportNotes [options]
Options:

/q query - query to filter the notes. If omitted, stdin is used to gather query specification.
/f file - export .enex file. If omitted, stdout is used.
/u username - user name if not the same as database file name.
/p password - user password to confirm Evernote service access.
/d database - database file name if user name is not specified.

If both database file name and user name are not specified, last login name is used and if there is none, USERNAME environment variable value is used as a user name.

Usage: ENScript createNotebook [options]
Options:

/n notebook - name of the notebook to create. If omitted, the notebook name is read from standard input.
/t {local|synced} - type of the notebook to create. If omitted, creates a synchronized notebook.
/u username - user name if not the same as database file name.
/p password - user password to confirm Evernote service access.
/d database - database file name if user name is not specified.

If both database file name and user name are not specified, last login name is used and if there is none, USERNAME environment variable value is used as a user name.

Usage: ENScript listNotebooks [options]
Options:

/t {local|synced} - type of the notebooks to list on stdout. If omitted, list all existing notebooks.
/u username - user name if not the same as database file name.
/p password - user password to confirm Evernote service access.
/d database - database file name if user name is not specified.

If both database file name and user name are not specified, last login name is used and if there is none, USERNAME environment variable value is used as a user name.

Usage: ENScript syncDatabase [options]
Options:

/l file name - log file name. Use standard log if omitted. Ignored in GUI implementation.
/u username - user name if not the same as database file name.
/p password - user password to confirm Evernote service access.
/d database - database file name if user name is not specified.

If both database file name and user name are not specified, last login name is used and if there is none, USERNAME environment variable value is used as a user name.


I also noted that as well as the ENScript command line option if you just want a quick and dirty method of adding a note to your default EverNote database you can pass it straight to the EverNote executable as a parameter.  This will add the file (e.g. a text or image file) to your default or currently selected (if you have EverNote open) notebook.

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments (5)

[...] IT The micro-blog for Reboot IT « ENScript – Scripting Evernote in Windows Send Web Cam Pictures to EverNote with SnapIT 23/08/2009 Since Google Notebook went out [...]

[...] a text file into Evernote and the text file could effectively be the template.  I posted the details of the ENScript syntax a while ago and so I referred back to this to put together a suitable command.  A simple batch [...]

[...] Via a script using ENScript. [...]

[...] for in Evernote is for the inclusion of templates.  I wrote a post in November 2009 about how ENSCRIPT could be used to automate the creation of notes in Evernote based on a template.  I’ve now [...]

[...] forward.  It begins by setting several variables which indicate where to files – the ENSCRIPT executable and the Evernote database.  This is followed by the location of three further [...]

PostPost a New Comment

Enter your information below to add a new comment.
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>