(*

QUIT ALL APPLICATIONS 1.0.1


A script which quits each running application, in the same order as a system shutdown or restart -- i.e. most recently launched first.

© 1996 Phil Hudson. May be freely used and distributed. Comments and bug reports please to: Released 18 Nov 1996.

Scripting additions required:


Warning:


Revision history:

1.0:
Initial release.
17 Oct 96.
1.0.1:
Added calls to "set cursor to busy".
18 Nov 96.

*)

set cursor to busy cursor with cursor list "MPW Cursor"
set appList to (reverse of (list applications)) -- list all currently running apps, youngest first

repeat with appX in appList -- for each app in turn:
	
	set cursor to busy cursor
	
	set bar to (application info for appX)
	if ((type of bar) = "APPL") then -- don't try to quit Finder or faceless background apps
		
		if (name of bar is not (name of (application info for (this application)))) then -- don't try to quit self
			
			ignoring application responses -- don't wait for a response/result
				with transaction -- fire off both commands in one package
					
					tell appX
						activate -- won't work without this!
						quit
					end tell
					
				end transaction
			end ignoring
			
		end if
		
	end if
	
end repeat

set cursor to arrow cursor



Top of page
Cool IT in Africa Site design by Phil Hudson. Comments? Email phil.hudson@iname.com.
Top of page