Re: Using a Handler with a Whose Clause
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.
Jim Underwood
aka JMichaelTX
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