Skip to content

Instantly share code, notes, and snippets.

@matsadler
Created April 15, 2009 12:01
Show Gist options
  • Save matsadler/95733 to your computer and use it in GitHub Desktop.
Save matsadler/95733 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'osx/cocoa'
include OSX
OSX.require_framework 'ScriptingBridge'
itunes = SBApplication.applicationWithBundleIdentifier( 'com.apple.itunes' )
itunes_window = itunes.windows.first
screen = NSScreen.screens.first
screen_width = screen.frame.width
screen_height = screen.frame.height
x = itunes_window.bounds.x
y = itunes_window.bounds.y
width = screen_width - x
height = screen_height - y
itunes_window.bounds = OSX::NSRect.new( x, y, width, height )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment