-
Notifications
You must be signed in to change notification settings - Fork 104
The Open Note Command
The command to open/search a note is
open_evernote_note
it accepts the following arguments:
Argument | Description |
---|---|
note_guid |
The unique id/link of a note to be opened, "clipboard" or "prompt" |
from_notebook |
A notebook's title |
with_tags |
A list of tags |
by_searching |
A bool, a string or {"snippet": template} (see below) |
order |
One of created , updated , relevance or title
|
ascending |
If true order in ascending order |
convert |
If true convert the contents to Markdown (default is true) |
In a keymap
{ "keys": ["super+e"], "command": "open_evernote_note", "args": {"by_searching": "tag:todo"} }
or from the console/a plugin
window.run_command("open_evernote_note", {"by_searching": "tag:todo "+view.substr(view.sel()[0])})
The open_evernote_note
command's arguments control how the note to be opened is selected.
If note_guid
is specified, the other arguments are ignored and the note with the specified guid is opened, if found.
This can be helpful in defining a key-binding that opens a favourite note.
From version 2.7.1, the note_guid
argument will also accept note links, parsing the guid from the link itself.
The note_guid
argument accepts two special values:
"clipboard"
(load the guid/link from clipboard) and "prompt"
(ask the user for a guid/link).
If note_guid
is not specified then a palette with a list of notes will be shown so the user can select the one to be opened. The notes in the palette are filtered according to the other arguments as follows.
If from_notebook
and/or with_tags
are specified, the notes in the palette will be filtered by notebook and tags.
The by_searching
argument can be:
-
true
then a prompt will ask for a query and the palette will show the results of the search. -
A string representing a search query: it will be used as the query without prompting. The search query can be an expression as documented here.
-
An object
{"snippet": template}
: thetemplate
string follows the Sublime Text Snippets' syntax. When the search prompt is presented, the prompt will be initialised with the snippet. Example:{ "keys": ["super+shift+e"], "command": "open_evernote_note", "args": {"by_searching": {"snippet": "tag:${1:food} $0"}}}
The from_notebook
and with_tags
arguments will also be used to filter the results if set. This can be useful to define key-bindings to saved searches.
The order
and ascending
control the order of the notes displayed in the palette.
The max_notes
setting controls the maximum number of notes that can be displayed in the palette.
The notes_order
and notes_order_ascending
settings set the default ordering.
These settings can be changed in Evernote.sublime-settings
.
If a search has only one result, the pallette is not displayed and the note is opened directly, unless the open_single_result
setting is set to false
.