Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

Create a bash script with

#!/bin/bash
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
add comment

Your Answer

 
discard

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.