Skip to content

Instantly share code, notes, and snippets.

@monzou monzou/alfred.applescript
Last active Jan 29, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.