Skip to content

Instantly share code, notes, and snippets.

@fstanley
Created June 26, 2012 04:00
Show Gist options
  • Save fstanley/2993203 to your computer and use it in GitHub Desktop.
Save fstanley/2993203 to your computer and use it in GitHub Desktop.
Powershell script to create a new Evernote note in a single command
# This script will create a new note in evernote. Set options to configure
param(
$note
)
# ---- OPTIONS ----
# Path to the Evernote executable. Not required if evernote is already on $PATH
$evernotePath="C:\Program Files (x86)\Evernote"
# Specify a notebook for new note. Leave blank for most recent notebook
$notebook=""
# Set max length of auto generated title
$maxTitleLength = 75
# Set a max length of the title
$title = $note.Substring(0,[Math]::Min($note.length,$maxTitleLength))
if($title.length -eq $maxTitleLength) {
$title+="..."
}
if ($notebook) {
echo "$note" | & "$evernotePath\ENScript.exe" createNote /i $title /n $notebook
} else {
echo "$note" | & "$evernotePath\ENScript.exe" createNote /i $title
}
@randomblink
Copy link

How do you 'run' this script? I'm new to Powershell and just stumbled here, any tips?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment