Skip to content

Instantly share code, notes, and snippets.

@monzou
Last active January 29, 2019 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monzou/692b0999dcc4658ec80014185c9a2481 to your computer and use it in GitHub Desktop.
Save monzou/692b0999dcc4658ec80014185c9a2481 to your computer and use it in GitHub Desktop.
Bear note templates
on alfred_script(q)
tell application "Terminal"
activate
do script q
delay 0.5
quit
end tell
end alfred_script
#!/bin/sh
cwd=$(pwd)
cd $(dirname "$0")
date=`date "+%Y/%m/%d"`
title=$2
template="$1.md"
text=`cat ./$template | sed -e "s#<TITLE>#${title:-日報}#g" | sed -e "s#<DATE>#$date#g"`
open "bear://x-callback-url/create?text=$text"
cd "${cwd}"
exit

<TITLE>


#nippo/

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