Re: Process whose frontmost *was* true?
Re: Process whose frontmost *was* true?
- Subject: Re: Process whose frontmost *was* true?
- From: David Durkee <email@hidden>
- Date: Thu, 27 May 2004 17:13:16 -0500
On May 27, 2004, at 12:50 PM, Jeff Porten wrote:
On May 27, 2004, at 10:48 AM, David Durkee wrote:
Executed from iKey, it currently displayed whatever was in front at
the time I pressed the key. There might be a reason why Key Xing is
discontinued.
I assumed it was because (number of registrants) * $7 / (hours of
support time) < value of time that could be spent on other software.
Otherwise, the software seems great, and I think my bug is
attributable to my own bad rather than theirs.
I shouldn't have slammed Key Xing sight unseen. Sorry. But you didn't
show us your script, which assumed was flawless.
However,
tell application "Finder" or "System Event" to set frontProcess to
every process whose frontmost is true
is not reliable. Consider this script when run from the Applescript
menu:
tell application "Finder" to get (displayed name of (path to frontmost
application))
-- Smile (or whatever app was in the front)
tell application "Finder" to get (name of every process whose
frontmost is true)
-- System Events
tell application "System Events" to get (name of every process whose
frontmost is true)
-- System Events
Hence, I'd suggest using the first example.
That may suggest a peculiarity in the way Applescript menu executes
scripts rather than a deficiency in "every process whose frontmost is
true". This, for instance, works in iKey:
tell application "System Events"
set aname to name of first application process whose frontmost is true
display dialog aname
end tell
Thanks to Graff for reminding me how to use whose clauses. I had tried
it before but had done it wrong and gotten an error and changed to the
repeat loop because it didn't really matter, I was only trying to test
iKey.
David
--
David Durkee
email@hidden
<
http://ddurkee.homeip.net/>
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.