Skip to content

Instantly share code, notes, and snippets.

@dinge
Created October 14, 2013 22:05
Show Gist options
  • Save dinge/6983008 to your computer and use it in GitHub Desktop.
Save dinge/6983008 to your computer and use it in GitHub Desktop.
calling applescript from ruby
def osascript(script)
system 'osascript', *script.split(/\n/).map { |line| ['-e', line] }.flatten
end
osascript <<-END
tell application "Finder"
display dialog "Hello"
end tell
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment