Lazy Automation: Ant Meets Autohotkey

Ok. I’m lazy. Really lazy.

Today I got tired of having to click around in Eclipse to run my Ant tasks  and decided to automate it with a shortcut in Autohotkey:


!r::
Run, %comspec% /c ant -f D:\CFProjects\cares\extensions\ant\avrs.db.build.xml cleanlocal
return

Lets break this down:

  • So the !r:: simply tells Autohotkey to assign this shortcut to Alt+R.
  • Run, %comspec% /c is a shortcut to cmd.exe.
  • Then I simply pass the path of my Ant script and the task I want run (cleanlocal).

This script simply resets my database data back to a know state and I run this frequently when developing.  So now a quick Alt+R and I’m done!

Recent Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>