Created
March 13, 2009 17:43
-
-
Save cohitre/78659 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby -wKU | |
require "rubygems" | |
# sudo gem install rubyosa | |
require "rbosa" | |
a = `osascript -e 'tell application "Finder" to get bounds of window of desktop'` | |
desktop_bounds = a.split(", ").collect{|i| i.to_i} | |
x1 = desktop_bounds[0] | |
x2 = desktop_bounds[2] | |
y1 = desktop_bounds[1] | |
y2 = desktop_bounds[3] | |
OSA.app("TextMate").windows.each do |w| | |
puts w.name | |
w.bounds = [ x2 - 555 , 0 , x2 , y2 ] | |
end | |
["Safari"].each do |a| | |
app = OSA.app(a) | |
puts a | |
app.activate | |
app.windows.each do |w| | |
w.bounds = [ 0 , 0 , x2-555 , y2] | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment