Using tell application "name" where the name comes from GUI Script...
Using tell application "name" where the name comes from GUI Script...
- Subject: Using tell application "name" where the name comes from GUI Script...
- From: "Kevin Bohan" <email@hidden>
- Date: Wed, 16 Apr 2003 14:56:34 +0000
Hi,
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
as below, even if the value of curr_name is "Finder". Can someone explain to
me how this should work, and how to fix it?
Thanks,
Kirby
Here's the code:
tell application "System Events"
set process_list to get every process
repeat with counter from 1 to count of process_list
set curr_proc to item counter of process_list
if accepts high level events of curr_proc = true and ,
not (creator type of curr_proc = "lgnw") and ,
not (creator type of curr_proc = "syui") and ,
not (creator type of curr_proc = "MACS") and ,
not (creator type of curr_proc = "sevs") then
set frontmost of curr_proc to true
set curr_name to name of curr_proc
tell application curr_name to quit
end if
end repeat
end tell
_________________________________________________________________
Overloaded with spam? With MSN 8, you can filter it out
http://join.msn.com/?page=features/junkmail&pgmarket=en-gb&XAPID=32&DI=1059
_______________________________________________
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.