Re: Application and application process are legacy in OS X finder suite: how do I find the frontmost app?
Re: Application and application process are legacy in OS X finder suite: how do I find the frontmost app?
- Subject: Re: Application and application process are legacy in OS X finder suite: how do I find the frontmost app?
- From: Timothy Bates <email@hidden>
- Date: Sun, 02 Jun 2002 17:03:10 +1000
Hi paul,
Thanks for your help
>
On 6/1/02 11:04 PM, "Timothy Bates" <email@hidden> wrote:
>
> tell application "Finder" -- X.1.4
>
> application process whose frontmost is true
>
> -->Can't get application whose frontmost = true.
>
> end tell
>
Nothing too serious is broken, Tim, or barely. That's improper syntax. God
>
knows what Akua or other coercion got it to work for you in OS 9, if it ever
>
did. (Actually there is an Akua term 'process' which may have come into play
>
here.) [this works]:
tell application "Finder"
item 1 of (every application process whose frontmost is true)
end
Still seems pretty weird to me: for instance these forms should all work (or
not be needed):
tell application "Finder" --10.1.4
every application process whose frontmost is true
-->OK: {application process "Script Debugger" of application "Finder"}
first application process whose frontmost is true
-->OK: {application process "Script Debugger" of application "Finder"}
application process whose frontmost is true
-->Bad: Can't get application process whose frontmost = true.
item 1 of every application process whose frontmost is true
-->Worse: Finder got an error: NSReceiverEvaluationScriptError: 3
end tell
It was the last one that caught me - just plain buggy.
I think what people forget is just how important it is in a verbose language
like AppleScript, to
1. Have ample coercions so that the varied language people use always works.
2. Use the generative syntax, not special long names that merely look like
generative syntax
Otherwise people can't tell or remember that the Finder is adding an "every"
to your command even if you don't, that adding a first will undo this, that
adding your own "every" might work, ut not if you then ask for item 1 of the
list etc.
Oh well, I am underway again for now.
Cheerio,
tim
_______________________________________________
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.