The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Scripting OS X Applications with Ruby

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jared Richardson

Posts: 1031
Nickname: jaredr
Registered: Jun, 2005

Jared Richardson is an author, speaker, and consultant who enjoys working with Ruby and Rails.
Scripting OS X Applications with Ruby Posted: Nov 20, 2007 1:53 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Jared Richardson.
Original Post: Scripting OS X Applications with Ruby
Feed Title: Agile Artisans
Feed URL: http://agileartisans.com/main/rss
Feed Description: Jared's Blog
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Jared Richardson
Latest Posts From Agile Artisans

Advertisement

I needed to pull some statistics and information out of TextMate but they don't have a formal API. Then a co-worker spotted this project

http://blog.ardes.com/2007/9/14/os-x-textmate-user-free-time-tracker-matewatch

which has an example of the RubyOSA bridge that exposes the Apple events that an application makes available. That is to say, I can get access to tons of applications (including iTunes and TextMate) from a Ruby app.

RubyOSA is easy to use. Here's a quick example that shows the list of your TextMate documents.

require 'rubygems'
require 'rbosa'
tm = OSA.app("Textmate")
tm.documents.each{|doc|
 puts doc.name
}

Another scriptable application is iTunes. You can just as easily type

iTunes = OSA.app('iTunes')
iTunes.pause
iTunes.play

But the question you'll immediately have is what methods are availabe for

Read: Scripting OS X Applications with Ruby

Topic: rcov 0.8.1: compatibility with Ruby 1.8.6-p11[01], intentional testing with RSpec, etc. Previous Topic   Next Topic Topic: Ruby/Rails Meetup - Using Amazon Simple Storage Service (S3) by Scott Patten - Dec/3 @ The...

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use