• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Application and application process are legacy in OS X finder suite: how do I find the frontmost app?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Application and application process are legacy in OS X finder suite: how do I find the frontmost app?
      • From: Christopher Nebel <email@hidden>
    • Re: Application and application process are legacy in OS X finder suite: how do I find the frontmost app?
      • From: Paul Skinner <email@hidden>
References: 
 >Re: Application and application process are legacy in OS X finder suite: how do I find the frontmost app? (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: Application and application process are legacy in OS X finder suite: how do I find the frontmost app?
  • Next by Date: [Newbie Q] How to implement toggle switch?
  • Previous by thread: Re: Application and application process are legacy in OS X finder suite: how do I find the frontmost app?
  • Next by thread: Re: Application and application process are legacy in OS X finder suite: how do I find the frontmost app?
  • Index(es):
    • Date
    • Thread