Using Ant and Say Command for Notification

Posted by: Terry Ryan on 05/23/2012

I use ANT to automate a lot of the work I do around the web.  Some things are so tedious I don’t want to have to do them.  Others just take a long time, and I would rather the computer spend that time instead of me.

The difficulty with that is ANT doesn’t notify you when it is done.  Sure it prints a message that it’s done in the terminal window, but unless you’re looking there, you’ll never know. I stumbled on an easy way of getting notifications that are flexible and easy to work with on OS X:

The say command

In OS X, go to your command line and type 

say hello

Your Mac should respond in creepy robotic tones “Hello.”

You can get it to say anything… Okay, get all the immature juvenile tricks out now. My personal favorite:

say "I've got the collywobbles."

Okay. You can make it say anything, so you can make it say:

say “I’m done uploading all of your files to the website.”

So make an ANT task like: 

And join it with another ANT task like:

Call them both from an ANT task like:

And there you have it. ANT with notification. Creepy creepy robotic notifications.

What I like about this over say, sound effects, is that this method allows me to label specifically what each notification means, which helps if I run a few concurrent processes.


About Terry Ryan

Terry Ryan

Terry Ryan is a Worldwide Developer Evangelist for Adobe. The job basically entails helping developers using Adobe technologies to be successful. His focus is on web and mobile technologies including expertise in both Flash and HTML. Previous to that, he spent a decade working in various technical roles at the Wharton School at the University of Pennsylvania.

Terry is also the author of Driving Technical Change, a Pragmatic Bookshelf title. It's about convincing reluctant co-workers to adopt new tools and ideas.

He blogs at http://terrenceryan.com/blog and is tpryan on Twitter.

More About Terry »

NFJS, the Magazine

May Issue Now Available
  • On the road to learning

    by Raju Gandhi
  • Refactoring to Modularity

    by Kirk Knoernschild
  • RESTful Groovy

    by Kenneth Kousen
  • Getting Started with D3.js

    by Brian Sletten
Learn More »