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}"
This article was published on Thursday, November 29th, 2007 at 9:48 pm.
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}"
If you're looking for something specific then give the search form below a try:
The Buzz {1 trackbacks/pingbacks}
The Conversation {2 comments}
>> 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
nevermind. i’m retarded. (there is an unwanted space in there).
Leave a Comment
You can follow any responses to this entry via its RSS comments feed. You can also leave a trackback if the inclination is there.