From c7333efbb5ce506da1c806221dafda745f461ab3 Mon Sep 17 00:00:00 2001 From: Artem Sapegin Date: Mon, 11 Feb 2013 00:14:30 +0400 Subject: [PATCH] Bash: add note to Notes.app alias. --- includes/bash_functions.bash | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/includes/bash_functions.bash b/includes/bash_functions.bash index 4e24a51..67fa197 100644 --- a/includes/bash_functions.bash +++ b/includes/bash_functions.bash @@ -242,6 +242,27 @@ function rasterize() { fi } +# Add note to Notes.app (OS X 10.8) +# Usage: note "foo" or echo "foo" | note +function note() { + local text + if [ -t 0 ]; then # Argument + text="$1" + else # Pipe + text=$(cat) + fi + body=$(echo "$text" | sed -E 's|$|
|g') + osascript >/dev/null <