andymatuschak.org: Asides

This article was published on Thursday, November 29th, 2007 at 9:48 pm.

Ohman, Scripting Bridge is so cool

RubyCocoa + Scripting Bridge = :)

require ‘osx/cocoa’
include OSX
require_framework ‘ScriptingBridge’
iTunes = SBApplication.applicationWithBundleIdentifier:
	‘com.apple.iTunes’
iTunes.playpause
puts "Now playing: #{iTunes.currentTrack.name}"

The Buzz {1 trackbacks/pingbacks}

  1. Pingback: The Ultimate List of RubyCocoa Tutorials, Tips and Tools on April 23, 2008

The Conversation {2 comments}

  1. ian 07 December, 07 @ 7:32 am

    :(

    >> require ‘osx/cocoa’
    => true
    >> include OSX
    => Object
    >> require_framework ‘ScriptingBridge’
    => true
    >> iTunes = SBApplication.applicationWithBundleIdentifier: ‘com.apple.iTunes’
    SyntaxError: compile error
    (irb):4: syntax error, unexpected ‘:’, expecting $end
    iTunes = SBApplication.applicationWithBundleIdentifier: ‘com.apple.iTunes’
    ^
    from (irb):4

  2. ian 07 December, 07 @ 7:43 am

    nevermind. i’m retarded. (there is an unwanted space in there).

Leave a Comment

Currently you have JavaScript disabled. In order to post comments, please make sure JavaScript and Cookies are enabled, and reload the page.

You can follow any responses to this entry via its RSS comments feed. You can also leave a trackback if the inclination is there.

If you're looking for something specific then give the search form below a try:

RSS Wordpress Grady (theme) Return to the Top ↑