Stupid Mac::Glue Tricks

pudge on 2003-10-30T22:27:31

I have my PowerBook sometimes connected to an external monitor. When MacCvsX leaves a window on the external monitor, it keeps it offscreen, whereas most applications will put the windows on the current monitor (or make it easy to arrange them on the current monitor). So I lose the Console Window forever, unless I can hook it up to a monitor, or ...

#!/usr/local/bin/perl use Mac::Glue;

my $cvs = new Mac::Glue "MacCvsX"; my $bounds = $cvs->prop(bounds => window => "Console Window"); my $d = $bounds->get; $bounds->set(to => [20, 100, $d->[2] - ($d->[0] - 20), $d->[3] - ($d->[1] - 100) ]);


(Requires most recent Mac::AppleEvents::Simple, v1.07.)