ACTION: Switch Case Based on FrontMost App
Download:
Switch Action based on FrontMost App.kmactions (2.4 KB)
NOTE: This file is for an Action, NOT a Macro.
Use Case
- Generally it is best to put your app-specific Macros in a Group which limits activation to the app of interest.
- But sometimes, you need to handle multiple apps within the same Macro.
- This Action is designed for those cases.
- Make sure the Macro is in a Group where all of the Apps of interest are in the "Available List" in the Macro Group definition.
- For details, see:
https://wiki.keyboardmaestro.com/action/Switch_or_Case
Install Instructions
- Download the Action file.
- In the KM Editor, select the Macro where you want to use this Action
- Select the existing Action, or a "No Action" input area, where you want the new Action to appear.
- Goto File > Import Actions..., and select the file you just downloaded.
- It will appear in your Macro.
You can repeat Steps 2-5 for other Macros if you wish. You can also just copy/paste the Action to a new Macro, or a different location in the existing Macro.
SETUP INSTRUCTIONS
Change, replace, or delete each CASE to match the Name of the App.
- If you use the "is" condition, then it must match the app name exactly.
- However, you can use the "matches" condition to provide a RegEx pattern to match against the app name.
- There are other conditions you can also use.
- For details, see:
https://wiki.keyboardmaestro.com/action/Switch_or_Case