Edit - If you're looking to do it through AppleScript, see: http://stackoverflow.com/questions/3690167/how-can-one-invok...