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: John Delacour <email@hidden>
- Date: Wed, 16 Apr 2003 19:41:19 +0100
- Mac-eudora-version: 6.0a15
[ Sent as UTF-7 from Eudora ]
At 2:56 pm ++0000 16/4/03, Kevin Bohan wrote:
I have about a day's experience Apple Scripting and I have bee
trying to use the new Apple Script GUI to control the process
currently running on my system. I figured if I iterate through the
process I could "tell" each application to do something. In the
example below I have each application quitting, except it doesn't
work. It appears to me this is because of the weak typing in Apple
Script, what appear to be just a string when you type
tell application "Finder" to something
is not interpreted the same as me having
tell application curr_name to something
If all you want to do is quit the applications, then no special
terminology is involved. With the exception of a few 10++ year old
applications, every app will respond to the required events, which
include 'quit'
There is a bug (one of many) in System Events which makes the line
below throw an error.
--
name of processes whose creator type is not in {"CSOm", "ToyS"}
--
So you have to write it like this. Never put a 'quit' event within a
Finder and (I guess) a System Events tell block.
tell app "System Events"
set pp to name of processes whose creator type is not "CSOm" and +AKw
creator type is not "ToyS" and +AKw
creator type is not "VIZF" and +AKw
creator type is not "dplt" and +AKw
visible is true
end
repeat with p in pp
tell app p to quit
end
--JD
_______________________________________________
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.