Remember "Quit all Applications"?

G’day all…

I used to make frequent use of the OS9 speakable item “Quit all Applications” to quit all apps except finder.

Is there a similar pre-built script in OSX or can anyone tell me how to script a similar result in OSX.

Thank you,

Graham.

You can try something like:

tell application "Finder"
	quit (every process whose name is not "loginwindow" or name is not "SystemUIServer")
end tell

You should probably first do something like:

tell application "Finder"
	get name of every process
end tell

This would give you a list of processes so you might determine what processes you might never want to quit like the Dock. Then, just use the first example to exclude those. I hope this gets you started.

Sorry TJ,

The only result I get is that the Finder quits!?

Cheers,

Graham

It’s going to help alot if you’ll post the code you’re having trouble with.
At this point, I don’t know which of my previous suggestions cause your Finder to quit.

If it’s the first, it’s naturally going to quit the Finder if you don’t exclude it from the ‘…quit every process…’ filter reference.

Further apologies TJ,

I first tried this script…

tell application “Finder”
quit (every process whose name is not “loginwindow” or name is not “SystemUIServer” or name is not “finder” or name is not “dock”)
end tell

and then a number of other scripts based on the same principle of identifying the process name and then trying to quit the process.

I reached the conclusion that Finder is reacting to the “quit” command without resolving the argument which follows.

I’ve had some success by first identifying the name of a process and then using…

tell application samplename
quit
end tell

This has some other inherent problems and I would much rather be able to tell the process to quit rather than telling the application to quit.

Thanks again,

Graham[/i]