Tuesday, July 14, 2020

#1 2002-12-08 07:49:12 pm

Trash Man
Sanitation Department
Registered: 2005-10-20
Posts: 5336

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.


One mans trash is another mans treasure

Offline

 

#2 2002-12-08 08:54:40 pm

T.J. Mahaffey
Administrator
From:: Arkansas, USA
Registered: 2002-11-20
Posts: 238
Website

Re: Remember "Quit all Applications"?

You can try something like:

Applescript:

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:

Applescript:

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.


T.J.
tj@tjmahaffey.com


Filed under: Finder

Offline

 

#3 2002-12-09 07:06:50 pm

Trash Man
Sanitation Department
Registered: 2005-10-20
Posts: 5336

Re: Remember "Quit all Applications"?

Sorry TJ,

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

Cheers,

Graham


One mans trash is another mans treasure

Offline

 

#4 2002-12-09 07:14:03 pm

T.J. Mahaffey
Administrator
From:: Arkansas, USA
Registered: 2002-11-20
Posts: 238
Website

Re: Remember "Quit all Applications"?

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.


T.J.
tj@tjmahaffey.com

Offline

 

#5 2002-12-09 10:30:15 pm

Trash Man
Sanitation Department
Registered: 2005-10-20
Posts: 5336

Re: Remember "Quit all Applications"?

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]


One mans trash is another mans treasure


Filed under: Finder

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)