[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

RejectConf RubyOSA hack

Gregory Brown

1/22/2007 11:32:00 PM

I remember vaguely from RejectConf someone hacked up something to
position windows on OS X using Ruby OSA.

Did this ever get released? Or at least, is that code available somewhere?

If anyone remembers this and has some info, I'd be much obliged.

I've been doing a lot of hacking on OS X lately rather than GNU/Linux,
and the window manager is nice but it ain't no DWM.

Something like the hack from RejectConf might help that some :)

7 Answers

Ezra Zygmuntowicz

1/23/2007 12:59:00 AM

0


On Jan 22, 2007, at 3:32 PM, Gregory Brown wrote:

> I remember vaguely from RejectConf someone hacked up something to
> position windows on OS X using Ruby OSA.
>
> Did this ever get released? Or at least, is that code available
> somewhere?
>
> If anyone remembers this and has some info, I'd be much obliged.
>
> I've been doing a lot of hacking on OS X lately rather than GNU/Linux,
> and the window manager is nice but it ain't no DWM.
>
> Something like the hack from RejectConf might help that some :)
>

Greg-

That was Sebastian Delmont who wrote that hack. I had a copy of it
somewhere but I cannot find it right now. I do knwo sebastians blog
though:

http://www.notsos...

Maybe you can find him armed with that info ;)

Cheers-
-- Ezra Zygmuntowicz
-- Lead Rails Evangelist
-- ez@engineyard.com
-- Engine Yard, Serious Rails Hosting
-- (866) 518-YARD (9273)



Gregory Brown

1/23/2007 2:23:00 AM

0

On 1/22/07, Ezra Zygmuntowicz <ezmobius@gmail.com> wrote:
>
> On Jan 22, 2007, at 3:32 PM, Gregory Brown wrote:
>
> > I remember vaguely from RejectConf someone hacked up something to
> > position windows on OS X using Ruby OSA.
> >
> > Did this ever get released? Or at least, is that code available
> > somewhere?
> >
> > If anyone remembers this and has some info, I'd be much obliged.
> >

Oh, i'll just hunt him down at a NYC.rb meeting or something. Thanks!

Gregory Brown

1/23/2007 2:24:00 AM

0

On 1/22/07, Ezra Zygmuntowicz <ezmobius@gmail.com> wrote:

> That was Sebastian Delmont who wrote that hack. I had a copy of it
> somewhere but I cannot find it right now. I do knwo sebastians blog
> though:

Oh, i'll just hunt him down at a NYC.rb meeting or something. Thanks!

hengist podd

1/23/2007 10:18:00 AM

0


Gregory Brown wrote:

> I remember vaguely from RejectConf someone hacked up something to
> position windows on OS X using Ruby OSA.
>
> Did this ever get released? Or at least, is that code available somewhere?

Dunno about RubyOSA, but here's the 'Stagger Finder Windows' example
from rb-appscript which might give you some ideas:

#######

#!/usr/bin/env ruby

# Rearranges Finder windows diagonally across screen with title bars
# one above another. (Could easily be adapted to work with any
# scriptable application that uses standard window class terminology.)

require "appscript"
include Appscript

x, y = 0, 44
offset = 22

# Get list of window references, ignoring any minimised windows
window_list = app('Finder').windows[its.collapsed.not].get

# Move windows while preserving their original sizes
window_list.reverse.each do |window|
x1, y1, x2, y2 = window.bounds.get
window.bounds.set([x, y, x2 - x1 + x, y2 - y1 + y])
x += offset
y += offset
end

#######

A couple of tips:

- If writing general-purpose a script to work with multiple apps, note
that the terminology tends to vary a bit: Carbon scriptable apps often
use 'collapsed' while Cocoa ones use 'minimized'. You could probably
just try 'minimized' first, then try 'collapsed' if an 'unknown
property' error occurs. If both fail, the app is probably
non-scriptable, in which case it'll either have to be ignored, or
controlled via System Events' GUI Scripting facilities.

- If you're writing a script to adjust multiple applications' windows
at once, some apps (e.g. Photoshop, InDesign, XCode) can have pretty
huge terminologies, so there may a perceptible delay while appscript
parses all of these these. Should you find the script lacks teh snappy
because of this, you could avoid the overhead by using the lower-level
AEM module, which uses raw Apple event codes, instead of the
terminology-driven Appscript module.

HTH

has
--
http://appscript.sourc...
http://rb-appscript.rub...

Gregory Brown

1/23/2007 6:51:00 PM

0

On 1/23/07, has <has.temp3@virgin.net> wrote:
>
> Gregory Brown wrote:
>
> > I remember vaguely from RejectConf someone hacked up something to
> > position windows on OS X using Ruby OSA.
> >
> > Did this ever get released? Or at least, is that code available somewhere?
>
> Dunno about RubyOSA, but here's the 'Stagger Finder Windows' example
> from rb-appscript which might give you some ideas:

Thanks for the snippet and the advice. Not sure when I'll get a
chance to play with all of this, but this post will sure help.

Charles Leeds

1/23/2007 10:10:00 PM

0

Has anyone successfully created an Exchange mailbox using Ruby? I am
stuck at a dead-end trying to do so.

Thanks,

Charles

The Peeler

12/8/2012 12:05:00 PM

0

On Fri, 7 Dec 2012 18:11:12 -0800 (PST), Dumb Ben "Chameleon?" Cramer,
Usenet's notorious nym-shifting Nazi troll from Australia, now trolling as
meistermoto@gmail.com wrote:

> On Friday, December 7, 2012 9:47:30 PM UTC+10, Heinrich wrote:
>> http://wakeupfromyourslumber.com/blog/fester/manifesto-first-anti-jewish-congress-dresden-se...
>
> Jews are hated by most all people from all countries.
>
> If the jews are as smart as they like to tell us they are, perhaps they might be in a position to accept responsibility for their actions.
>
> Of course they aren't smart and they won't ever accept responsibility for anything.
>
> Such scum, them

Replace "Jews" with "Nazi scum" and you've finally managed to say something
much closer to the truth, Dumb Ben "Chameleon?" Cramer! <G>