• 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: Using a Handler with a Whose Clause
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using a Handler with a Whose Clause


  • Subject: Re: Using a Handler with a Whose Clause
  • From: Yvan KOENIG <email@hidden>
  • Date: Mon, 5 Jun 2017 22:43:53 +0200

Life would be too much easy.

My first message shown that the Finder accepts a whose clause applying to a list
the late one shown that System Events doesn't accept such syntax.

In fact, if my memory is right, the behavior of whose is not a standard one. It depends of the way the application author implemented the feature.


Yvan KOENIG running Sierra 10.12.5 in French (VALLAURIS, France) lundi 5 juin 2017 22:43:00



Le 5 juin 2017 à 22:37, Jim Underwood <email@hidden> a écrit :

Thanks, Yvan.

So I guess this means that the terms used with a whose clause is application dependent.
Disappointing and confusing.  I had always thought that it was as AppleScript term that applied to all apps.

Best Regards,

Jim Underwood
aka JMichaelTX


From: AppleScript-Users <applescript-users-bounces+jmichael=email@hidden> on behalf of Yvan KOENIG <email@hidden>
Date: Monday, June 5, 2017 at 3:30 PM
To: "ASUL (AppleScript)" <email@hidden>
Subject: Re: Using a Handler with a Whose Clause

System Events refuse to apply whose to a list of file names.

tell application "System Events"
set appNameList to every application process whose name is in {"Keyboard Maestro", "Finder", "Script Debugger"}
end tell
--> error "Erreur dans System Events : Impossible de convertir {\"Keyboard Maestro\", \"Finder\", \"Script Debugger\"} en type specifier." number -1700 from {"Keyboard Maestro", "Finder", "Script Debugger"} to specifier


We must test names one by one.

tell application "System Events"
set appNameList to every application process whose (name is "Keyboard Maestro") or (name is "Finder") or name is "Script Debugger"
end tell
--> {application process "Finder" of application "System Events", application process "Script Debugger" of application "System Events"}


Yvan KOENIG running Sierra 10.12.5 in French (VALLAURIS, France) lundi 5 juin 2017 22:28:36



 _______________________________________________
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/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: Using a Handler with a Whose Clause (From: "Stockly, Ed" <email@hidden>)
 >Re: Using a Handler with a Whose Clause (From: Yvan KOENIG <email@hidden>)
 >Re: Using a Handler with a Whose Clause (From: Jim Underwood <email@hidden>)

  • Prev by Date: Re: Using a Handler with a Whose Clause
  • Next by Date: Copying a Safari Page's Text to a Mail Message
  • Previous by thread: Re: Using a Handler with a Whose Clause
  • Next by thread: Re: Using a Handler with a Whose Clause
  • Index(es):
    • Date
    • Thread