Re: so what's going on here?
Re: so what's going on here?
- Subject: Re: so what's going on here?
- From: Bill Briggs <email@hidden>
- Date: Mon, 19 Feb 2007 22:23:49 -0400
Title: Re: so what's going on here?
At 11:36 AM -0800 2/19/07, Paul Berkowitz wrote:
On 2/19/07 11:09 AM,
"Bill Briggs" <email@hidden> wrote:
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.
System Events is
what's running the OS script menu itself. So it is the
frontmost process, although not visible.
If that's the reason, then it seems like some kind of
violation of the spirit of "frontmost". FBAs are faceless
for a reason. They shouldn't be frontmost precisely because they are
not visible.
And it gets more strange. If you exclude System Events
specifically by filtering to get application processes whose
background only is false (and System Events has a background only that
is true), then Script Editor pops up as the frontmost application, no
matter what application is frontmost.
I just extracted the bit of code that found the frontmost
application and got it displayed in a dialog, and when I do that it's
Script Editor that shows as the frontmost when you have purposely
excluded System Events. Doesn't matter whether it's Eudora, Safari, or
some other application. It's coming back as Script Editor. There's
something wrong here. FastScripts menu gives proper execution (it
doesn't make itself the frontmost application). TypeIt4Me gets it
right. But the regular scripts menu is doing something that doesn't
smell right.
However, in Tiger,
'path to frontmost application' (the 'path to' scripting addition) is
"smart" and ignores the script menu and System Events
running it, instead returning the "otherwise" (i.e.
intuitive) frontmost app, the one you want. So get that instead. Since
you can use the whole file path when targeting an application, there's
no need to parse it for just the name.
set fMostAp to
(path to frontmost application) as Unicode text
should do what you
want.
I'll try that to see if it works, but I'm not satisfied
that, given the behaviour noted, there isn't some kind of bug here. I
just tried another test and every application that I had running came
back with it's frontmost "true". That's not possible.
- 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