• 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
Using tell application "name" where the name comes from GUI Script...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
  • Follow-Ups:
    • Script in Script Editor MUCH faster than compiled app -- why?
      • From: Jeff Porten <email@hidden>
    • Re: Using tell application "name" where the name comes from GUI Script...
      • From: John Delacour <email@hidden>
    • Re: Using tell application "name" where the name comes from GUI Script...
      • From: Bill Cheeseman <email@hidden>
  • Prev by Date: Re: Script application hdiutil mount errors
  • Next by Date: RE: Script application hdiutil mount errors
  • Previous by thread: Re: Script application hdiutil mount errors
  • Next by thread: Re: Using tell application "name" where the name comes from GUI Script...
  • Index(es):
    • Date
    • Thread