Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What I'm looking to accomplish is have something trigger a git add *.txt and git commit -m "Automated Commit `date`' when I close Notational Velocity. I'm guessing I could probably accomplish this with an AppleScript but I don't know the language well enough. I looked into creating a launchd plist that would watch the main database file and that didn't seem to cause it to trigger a commit at all. Does anyone know of a good way to accomplish this?

share|improve this question
up vote 2 down vote accepted

You can use Keyboard Maestro to completely automate the task. Here's a screenshot of a macro doing just that :

enter image description here

You should adapt the bash script to suit your needs, I'm not sure how to include the date in the commit message (in addition, I forgot to put the git add command).

share|improve this answer
I haven't tried it yet but this looks like what I was trying to accomplish, thanks! – Gekitsuu Aug 4 '11 at 15:10
You're welcome :) – olivier Aug 4 '11 at 15:31
Once I have enough rep I will come back and upvote this :/ – Gekitsuu Aug 4 '11 at 16:14

Create a bash script with

cd /path/to/notational/velocity/folder
NOW=$(date +"%m-%d-%Y")
git add *.txt
git commit -m "Automated commit $NOW"
killall NotationVelocity # or whatever its name is

Then save the script, make it executable with

chmod +x name of the script

and when you want to close NV, just double-click the script.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.