so what's going on here?
so what's going on here?
- Subject: so what's going on here?
- From: Bill Briggs <email@hidden>
- Date: Mon, 19 Feb 2007 15:09:45 -0400
Title: so what's going on here?
I've got something here that's a bit of a puzzle, and on cursory
examination it's not making a lot of sense.
I use the script below to resize windows that were open on an
external (larger) monitor and are now back on my PowerBook where the
resize handles are no longer available.
tell application "System Events"
set fMostList to the name
of every application
process
whose
frontmost
is true
end
tell
set fMostAp to
(get item 1
of
fMostList)
tell application "Finder"
set dBounds to
bounds
of desktop's window
-- this gets the
size of you computers screen
end
tell
-- the next two
lines calculate a reasonable size window based on your desktop
size
-- and it
compensates for the dock, if it's on the bottom of your
screen
set goodWindowWide to round
((item 3 of
dBounds) * 2 /
3)
set goodWindowDeep to ((item
4 of dBounds) -
84)
try
tell application fMostAp
set bounds of front window to
{2, 44,
goodWindowWide,
goodWindowDeep}
end
tell
on
error
display dialog "This application doesn't play well with
AppleScript."
end
try
The interesting thing is this. When I run this script via
TypeIt4Me (it now has the ability to run AppleScripts, which is great)
it works on any application that will allow one to resize a window.
The front window of the frontmost application gets fixed, just as I
want it to. When run from the FastScripts menu it also works as
expected.
But when I run it from the Mac's native scripts menu it doesn't
work. After a bit of tinkering and testing I've noticed that it seems
to think that System Events is the frontmost application. But given
that System Events isn't even visible, that doesn't make any sense
either.
Anyone vote for a bug here? It's not making any sense to
me.
- web
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users
This email sent to email@hidden