Skip to content

Instantly share code, notes, and snippets.

@mxcl
Created February 4, 2010 13:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mxcl/294613 to your computer and use it in GitHub Desktop.
Save mxcl/294613 to your computer and use it in GitHub Desktop.
Convenience script for running certain Applescripts
#!/usr/bin/ruby
#
# Example usage:
# tell iTunes to pause
# tell iTunes to play
# tell Linkinus to quit
#
# http://twitter.com/mxcl
# we add it back later
ARGV.shift if ARGV.first == 'application'
# add slashes as convenience for appname parameter
ARGV[0] = '"%s"' % ARGV[0] unless ARGV[0] =~ /".*"/
exec "/usr/bin/osascript", "-e", "tell application #{ARGV*' '}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment