Skip to content

Instantly share code, notes, and snippets.

@cohitre
Created March 13, 2009 17:43
Show Gist options
  • Save cohitre/78659 to your computer and use it in GitHub Desktop.
Save cohitre/78659 to your computer and use it in GitHub Desktop.
#!/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