Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Access iTunes with MacRuby through Scripting Bridge

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 README.md
Octocat-spinner-32 iTunes.bridgesupport
Octocat-spinner-32 iTunes.h
Octocat-spinner-32 itunes.rb
README.md

Access iTunes with MacRuby through Scripting Bridge

Prerequisites: MacRuby

Example usage:

ITunesManager.app.run

# start playing at the beginning
ITunesManager.music.playOnce(false)

ITunesManager.player_state  #=> :playing

ITunesManager.app.playpause
ITunesManager.player_state  #=> :paused

track = ITunesManager.current_track

# for more properties, see iTunes.h under "@interface iTunesTrack"
track.name
track.artist
track.album

# playlist management
favorites = ITunesManager.find_or_create_playlist 'Favorites'

track = ITunesManager.music.fileTracks.first
favorites << track

favorites.add ITunesManager.music.search('daft punk')
favorites.add ITunesManager.music.search('pendulum', :artists)
favorites.add ITunesManager.music.search('easy rider', :albums)
Something went wrong with that request. Please try again.