Created
June 26, 2012 04:00
-
-
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How do you 'run' this script? I'm new to Powershell and just stumbled here, any tips?