Quit all applications macro

Is it possible to create a macro to quit all applications ?
thanks in advance for your time and help

Just use the Quit Other Applications action. The excluded applications list is in the preferences.


I find it useful to split this macro into two parts
Quit specific applications that are likely to say "do you want to save xxxxxx first?
a quit all i.e. everything else remaining.

That way you do not wait for an app to time out then for another to ask if you want to save.....


@jonathonl When I first saw your reply I thought, wow that's a really good idea, but I just tested my own 'close all app' macro which just runs the one action and it didn't seem to not close any apps just because textedit and word were waiting for me to answer the 'do you want to save' question. If that makes sense. In other words, it seems to act like your proposed 2 part macro would act regardless.

Am I missing something here?

1 Like

I think that it's a great idea and do it for individual applications. In the context of close all applications, how do you manage excluding certain apps ? Do you create one action per app to close ? Seem like quite a tedious exercise.
thanks for your comment

I see the same thing as @jonathon. What I run the close all apps action, I am asked if I want to save or not
thank you for your comment

Yes, that does happen, which is what we want of course, we don't want Word to close if we haven't saved the document, but in my experience, all apps that didn't need to ask me about saving, closed in the background in the meantime, eliminating the need for two separate macros. Perhaps I was mistaken, but that's what I thought I experienced when I tested it.

You exclude certain apps from the close all commands by going to Keyboard Maestro preferences, then 'Excluded' (far right), and add them there.

I have used an Applescript in the past to close all non-academic apps, I can't remember who I took it from, probably someone on here, and must admit to not knowing exactly what is happening, but it is easy to modify to your own use. You add the script below to a 'Execute Applescript' action. Good luck! :slight_smile:

set myDoNotQuitList to {"TextEdit", "BBEdit", "Keyboard Maestro", "Scrivener", "Zotero", "Safari", "Chrome", "Books", "Preview", "Microsoft Word"}

tell application "System Events"
	set quit delay to 0
	set appList to name of processes whose background only is false
end tell

repeat with i in appList
	if i is in myDoNotQuitList then set contents of i to 0
end repeat

set appList to text of appList

repeat with i in appList
	tell application i to quit
end repeat

1 Like

thank you very much !

1 Like