Jump to content
bubbabr

Quit all except [named app]

Recommended Posts

I've seen variations of this question elsewhere, but not exactly what I'm looking for.

 

I've been using Alfred's 'Quit All Apps' to tidy up open applications at the end of my study sessions.  But I have a certain app (Tick Tick) that I need to stay open in the background even when it receives a quit command.  I'm a complete novice as far as workflows are concerned but what I'd like to do is either i) create a custom workflow that replicates Alfred's 'Quit All Apps' command, but with an exception or ii) find a way to edit the 'Quit All Apps' command so that it excludes Tick Tick (not sure if this is even possible).  I'd like to tricker this workflow with a keyword.

 

Any help gratefully received.  

Share this post


Link to post

Welcome @bubbabr,

 

3 hours ago, bubbabr said:

stay open in the background even when it receives a quit command.

 

That‘s not possible. If an app gets a quit command, it means you want it to quit. This is handled by the system; it’s not optional.

 

3 hours ago, bubbabr said:

create a custom workflow that replicates Alfred's 'Quit All Apps' command, but with an exception

 

This is the right solution. The trick is ask the system for a list of all apps, remove the one we want, then tell all apps on the list to quit. Here’s a ready-made Workflow. It’s untested, but should work.

Share this post


Link to post

Hi! Great, I was looking for such an solution and I'm glad I've found such a "fresh" one. I'm not into coding at all, so what I didn't find out by trial an error is: where do I have to write in the name of the App that should stay alive? (I want Firefox to stay).

 

help at this gratefully received

Share this post


Link to post

Thanks for the fast answer. OK, I found that an made a keep_alive with value Firefox and deleted the one with the value Tik Tok.

Than with alt+space and Keyword "fire" everything showed up like expected, but didn't execute

image.png.12975a698f03c31199b0911e9f227a72.pnghitting return or klicking the higlighted with the mouse didn't produce a result.

Is there something I forgot to do?

Share this post


Link to post
5 hours ago, vitor said:

Welcome @bubbabr,

 

 

That‘s not possible. If an app gets a quit command, it means you want it to quit. This is handled by the system; it’s not optional.

 

 

This is the right solution. The trick is ask the system for a list of all apps, remove the one we want, then tell all apps on the list to quit. Here’s a ready-made Workflow. It’s untested, but should work.

 

Hi vitor, thanks for the reply.  Doesn't work for me unfortunately - the workflow executes, but closes all apps including Tick Tick (nice bonus is that the workflow closes open Finder windows, another thing I was trying to work out). Also, side side question - if Tick Tick is listed in the variables, what's the point of requiring an argument to go with the Highlander keyword?  Why wouldn't the workflow execute without the need for a keyword?

Share this post


Link to post
5 hours ago, bubbabr said:

the workflow executes, but closes all apps including Tick Tick

 

Open Tick Tick. Open the Script Editor app, paste this code, run it (⌘R), and post the result.

tell application "System Events" to return (name of every process where background only is false)

You shouldn’t run stray code from the internet without understanding it, but that should be pretty clear. What it will do is return a list of every running app. It’s possible that `Tick Tick` is calling itself by a different name, and it should show there.

 

5 hours ago, bubbabr said:

side question - if Tick Tick is listed in the variables, what's the point of requiring an argument to go with the Highlander keyword?

 

That’s the default and I forgot to change it. No argument is required.

Share this post


Link to post
10 hours ago, palatinatemike said:

hitting return or klicking the higlighted with the mouse didn't produce a result.

Is there something I forgot to do?

 

See the other replies. I forgot to make the Keyword argument optional. Change it or download it again (same URL), as I’ve corrected that.

Share this post


Link to post
2 hours ago, vitor said:

 

Open Tick Tick. Open the Script Editor app, paste this code, run it (⌘R), and post the result.


tell application "System Events" to return (name of every process where background only is false)

You shouldn’t run stray code from the internet without understanding it, but that should be pretty clear. What it will do is return a list of every running app. It’s possible that `Tick Tick` is calling itself by a different name, and it should show there.

 

 

That’s the default and I forgot to change it. No argument is required.

 

My bad - the app in question is in fact TickTick (without a space), so changing the variable accordingly got it sorted.  Many thanks vitor.

Share this post


Link to post
6 hours ago, vitor said:

 

See the other replies. I forgot to make the Keyword argument optional. Change it or download it again (same URL), as I’ve corrected that.

Thanks a lot for your help. I wouldn't have recognized, that the answer was given in the other replies - due to my bad english.

I've downloaded it again and set 'firefox' as value. It works great. Thanks a lot again!

Share this post


Link to post
22 hours ago, vitor said:

 

See the other replies. I forgot to make the Keyword argument optional. Change it or download it again (same URL), as I’ve corrected that.

 

The plot thickens - how can I add multiple exceptions to this?  I tried adding another 'keep alive' variable (and adding a different app to it) but I'm guessing they have to be unique?

Share this post


Link to post
12 minutes ago, bubbabr said:

how can I add multiple exceptions to this?

 

See the new version (same URL). It has instructions. It’s also untested.

Share this post


Link to post
On 6/8/2019 at 2:30 PM, vitor said:

 

See the new version (same URL). It has instructions. It’s also untested.

Thanks viator. The newly version tries to close the second app listed - Fantastical 2. Below is the output from the earlier script editor text you provided, which seems to confirm the name of the app is Fantastical 2:

 

{"Google Chrome", "Finder", "Script Editor", "Fantastical 2"} 

 

I've also attached an image of how I've entered the apps to exclude from closing.

 

Any thoughts?

Webp.net-compress-image.jpg

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...