Jump to content
flatlanderdox

Command line arguments in Evernote/ENScript

Recommended Posts

I just recently wrote this article on Lifehacker on how to Create Desktop Shortcuts to Your Favorite Evernote Notes and Tags.

 

w6taatrjkhrxa1zv62vl.jpg

 

I know you can use command line to do even more than just saved searches -- e.g. creating new notes with certain tags, etc.  But I'm not sure what that looks like. 

 

In the example pictured above, I add the following code to the end of the "Target" field in the desktop shortcut:

showNotes /q "notebook:Lists"

If I was to create a desktop shortcut to create a new note with a given tag, what would that syntax look like? where would I put it?

 

Thanks in advance.

 

 

Share this post


Link to post

Thanks Jeff.

 

Right, my question is about how to get these parameters to work in a desktop shortcut.  I can't seem to figure out how to do this.

 

I can get the showNotes parameters to work (e.g. for the tag "Wiki"):

 showNotes /q "tag:""Wiki""

But if I try something similar with the createNote command, it doesn't work for me (e.g. creating a new note in the "Reference" notebook):

createNote /n "Reference"

I'm obviously doing something wrong, but not sure what.

Share this post


Link to post

Ah, OK. The createNote option is different. You need a parameter to specify the note's text content with the /s parameter; the associated file must be text. If you leave out the /s parameter, text content is read from standard input. When running ENScript on the command line, that would mean that you'd just type in some, with Ctrl+Z to finish.I'm not sure how that works in a shortcut. If you wanted to do some boilerplate (say, an empty note), you could probably do something like: createNote /n MyNotebook /s MyBlankFile.txt. You'd use the /a option to attach non-text files.

  • Like 1

Share this post


Link to post

Awesome, thanks so much Jeff!

createNote /s "C:\New note.txt" /n "Test Notebook" /i "This a Test" /t "test"

The syntax above (added after the filepath to ENScript.exe) creates a new note with the plain text of the .txt file in the notebook "Test Notebook", title "This is a Test" and tagged "test". Very cool to know how to do this!

 

I'm not sure what is meant by "text content is read from standard input". What is "standard input"?

Share this post


Link to post

In the command line world (e.g.  DOS, Windows' Command Prompt, etc.) programs can interact with command line users via standard input (typing) and standard output (writing text to the console). For such programs, the command line program usually makes available the ability to send the contents of a file into the standard input channel of the program, such that whatever is in the file appears to the program as if you'd typed it manually. That's called "redirecting standard input" (commonly triggered on the command line using the "<" symbol). Similarly, you can usually capture the standard output of such a program into a file on disk (commonly triggered on the command line using the ">" symbol).

  • Like 1

Share this post


Link to post

Oh okay. Wow, thanks for that explanation! I've only just started learning about stuff like this. Seems like there are so many possibilities. Really appreciate your help.

Share this post


Link to post

Check out this guys great post on some power creating notes.

 

http://www.thoughtasylum.com/blog/2010/3/14/an-improved-template-system-for-evernote.html

 

I've quite successfully taken his concept and extended it further to combine a bunch of separate files of each part of the notes EXEX that are combined with variables from the OS (windows user-name, current date, time, a command line input for project name) and then create a new note for each job as they come in.

  • Like 1

Share this post


Link to post

Check out this guys great post on some power creating notes.

 

http://www.thoughtasylum.com/blog/2010/3/14/an-improved-template-system-for-evernote.html

 

I've quite successfully taken his concept and extended it further to combine a bunch of separate files of each part of the notes EXEX that are combined with variables from the OS (windows user-name, current date, time, a command line input for project name) and then create a new note for each job as they come in.

Very cool stuff. I love Stephen's approach. I keep meaning to dive more deeply into his process and the one Itmar O mentions in the comments.

Share this post


Link to post

×
×
  • Create New...