Can I launch an app when I start another one?

Hi,
I need for my work some specific apps to launch, so I want to know if BTT can do something like this?
Can I launch an app when I start another one?

Thanks

Either if you start it using BTT you just can associate a second action like

  1. Launch application XY
  2. Launch application YX

An other way could be using a conditional activation group and an Apple script like

if application "YX" is running
Return "running"
Else
Tell application "YX"
Activate
End Tell
End if

Hi,
Do you mean I can create an action that launches App 1 when I start App 2? If so, then where do you do that? I couldn't find anything.
And I don't want to use a script, because I have to activate it. I want, if that is possible, that it works automatically.

Thanks

I assume you want to launch the first app from the Touch Bar. Just setup an AppleScript Widget Button in your BTT preset. Use the above script to launch the first app, and it will launch both apps for you.

If you dont want to use an AppleScript, you can also set the BTT Button action to Launch Application, then add another action to Launch another application. Two apps launch when you touch button.

Not really, because I don't have a Touch Bar to use. Now I solved the problem with a shortcut action, using the F1 key.

Thanks for your help anyway.

What I actually meant was creating a Conditional Activation Group that launches the second app as soon as the first you need is open. No need to run the script manually this way. In the example below Firefox starts in the background as soon as Safari is the frontmost application (which is the case when you start it, basically). To achieve this follow these instructions:

  1. Create a conditional activation group (lower left corner plus) with the following conditions
  2. Save, and hit ⌘9 in order to get to the triggers section.
  3. There, add a new trigger "If CAG is activated" with the assigned action to run the apple script above. Should look like this.

Works like a charm!


Easier way, set one gesture or whatever that launches all the programs you want to. Inconvenient, you'll always have to perform that gesture. Advantage, it won't run the script each time the App (Safari in our example) gets frontmost. Using the CAG you can launch your program the way you want.

Hi,
I follow your steps with the CAG option, but when I start application 1, nothing happens. The app just opens. Do I have to activate the CAG?
Here is how it looks for me:

You have to give a name to the CAG and enter it on the right of your screen → "Name der bedingended Aktivierungsgruppe". If the trigger doesn't know which CAG has to launch it, it won't work :wink:

Ah ok. I had some issues with the start trigger, but I solve it with a script command instead. Now it works how it should. Thank you very much for your help.

Now I have one more question. Can I use the deactivate CAG trigger to quit both apps at the same time? I used a script to quit them, but it doesn't seem to work.

Does someone have any suggestions or ideas?

By the way, the latest alphas have new triggers

"Specific APplication Did Launch" and "Specific Application Did Terminate". They would be easier to use as the conditional activation groups:

BTT currently doesn't have an action to quit a specific app, but you could either use the "run terminal command" action with something like pkill -x Slack or an Apple Script action with something like

tell application "Google Chrome"
    quit
end tell
1 Like

Hi, this sounds great. I can't wait to try it out.
Will it release soon?

I already know that, but I would like to quit 2 Apps at the same time. For example, whenever I quit App A, App B quit as well. But I don't know how to do it.
Do you know a way to do that?

You can already use the alpha (just run "Check for Alpha Version Updates").

To quit two apps at the same time, either just duplicate the apple script code in one script

tell application "Google Chrome"
    quit
end tell
tell application "Safari"
    quit
end tell

Or alternatively just chain a few of the BTT actions:

I just found this trigger what I did in the beginning to quit both apps, but it doesn't work.

Since I had bad experiences with other apps, I'm not sure about the Alpha version. They mostly are instable and have some bugs, so I will wait until the stable version is released.

I'm looking for a way to start this script automatically.