-
-
Save mxcl/294613 to your computer and use it in GitHub Desktop.
Convenience script for running certain Applescripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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