Re: Using tell application "name" where the name comes from GUI Script...
Re: Using tell application "name" where the name comes from GUI Script...
- Subject: Re: Using tell application "name" where the name comes from GUI Script...
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 17 Apr 2003 06:43:22 -0700
On 4/17/03 3:54 AM, "Kevin Bohan" <email@hidden> wrote:
>
4. I have two process with similar creator type. They only differ by string
>
case. One is the Dock which has a creator type of 'dock', and the other is
>
DragThing which has a creator type of 'Dock'. The code you gave me doesn't
>
distinguish between these two codes. So, I put a "considering case" block
>
around it. However, this still doesn't work.
>
>
Any idea how I can get this to distinguish creator codes based on case?
Evidently 'considering case' does not operate on whose clause parameters
here. It's most unfortunate (even 'get name of first process whose creator
type is "Dock" ' is always "Dock" and not "DragThing".) Since you're
looking for something specific here you can just do:
tell application "System Events"
set pp to name of application processes whose creator type is not
"CSOm" and ,
creator type is not "ToyS" and ,
creator type is not "VIZF" and ,
creator type is not "dplt" and ,
creator type is not "lgnw" and ,
creator type is not "syui" and ,
creator type is not "MACS" and ,
name is not "Dock" and ,
creator type is not "sevs"
end tell
(Bill also showed you how to quit the application process, which is going to
be neater in some cases than quitting teh application.)
>
>
Here's my new code:
>
>
tell application "System Events"
>
considering case
>
set pp to name of application processes whose creator type is not "CSOm"
>
and ,
>
creator type is not "ToyS" and ,
>
creator type is not "VIZF" and ,
>
creator type is not "dplt" and ,
>
creator type is not "lgnw" and ,
>
creator type is not "syui" and ,
>
creator type is not "MACS" and ,
>
creator type is not "dock" and ,
>
creator type is not "sevs"
>
end considering
>
end tell
>
>
repeat with p in pp
>
try
>
ignoring application responses
>
tell application p to quit
>
end ignoring
>
end try
>
end repeat
>
--
Paul Berkowitz
_______________________________________________
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.