24 Feb
2009
24 Feb
'09
4:05 p.m.
One way of achieving this is by using rb-appscript, which you can install as a rubygem: http://appscript.sourceforge.net/rb-appscript/index.html There's also the Scripting Bridge: http://developer.apple.com/documentation/Cocoa/Conceptual/RubyPythonCocoa/Ar... /apple_ref/doc/uid/TP40005424-SW1 The rb-appscript version of your Applescript would look like this: require "rubygems" require "appscript" include Appscript res = (`/usr/sbin/system_profiler SPDisplaysDataType | grep Resolution`).split width,height = res.grep(/\d+/) window = app("System Events").processes[its.frontmost.eq(true)].windows[1] window.position.set([0, 22]) window.size.set([width, height]) -al