Show/Hide Palette for FrontMost App

Use Case

  • This macro allows you to keep your Macro Group always Active while also being able to display the macros in that Group in a Palette.
    .
  • You do NOT have to create another Macro Group which contains duplicates, or "aliases" for the Macros in your main Group.

2017-09-14 20:07 CT

In Ver 1.1 I have fixed the issue that the Macro Group was NOT active after using this macro. It is now ACTIVE.

Just make sure the Switch Case for each App looks like this:

Of course, you much change the Macro Group to match the Macro Group that you are showing above.


MACRO:   @Palette Show/Hide Palette for @FrontMost App


VER: 1.1    2017-09-14 ~~~

DOWNLOAD:

@Palette Show-Hide Palette for @FrontMost App.kmmacros (25 KB)
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.


ReleaseNotes

Author.@JMichaelTX

PURPOSE:

  • Show/Hide a Palette for a Specified Group Based on FrontMost App
    • Can either Show the Palette until triggered again
      OR
    • Show the Palette for ONE Action Only

HOW TO USE:

  1. Make the App of interest frontmost
  2. Trigger this macro

MACRO SETUP

  • Carefully review the Release Notes and the Macro Actions
    • Make sure you understand what the Macro will do.
    • You are responsible for running the Macro, not me. :wink:
      .
  • Assign a Trigger to this macro. I prefer ⌃⇧P.
  • Move this macro to a Macro Group that is only Active when you need this Macro.
  • ENABLE this Macro.
    .
  • REVIEW/CHANGE THE FOLLOWING MACRO ACTIONS:
    .
    • I have included the Switch Cases for ALL of the Apps that I use this Macro with.
    • You will need to change or delete the Cases to match your KM Groups and requirements.
      .
    • "SWITCH Based on App"
      • Change/Delete/Add Cases for each App you want to show a palette for
      • In the "Show/Hide" Action, choose the option you want:
        • Show/Hide palette
        • Show palette for one action
      • In the "Macro group" popup menu, choose the Macro Group you want to use for this app/palette
      • Be sure to include these three Actions AFTER the Show/Hide Palette Action:
        • Pause Until that Macro Group is INACTIVE
        • Pause 1 sec
        • Activate that Macro Group

TAGS: @Palette @Group @Macro

REQUIRES:

  1. Keyboard Maestro Ver 7.3+ (don't even ask me about KM 6 support).
  2. El Capitan 10.11.6+
  • It make work with Yosemite, but I make no guarantees.

USE AT YOUR OWN RISK

  • While I have given this limited testing, and to the best of my knowledge will do no harm, I cannot guarantee it.
  • If you have any doubts or questions:
    • Ask first
    • Turn on the KM Debugger from the KM Status Menu, and step through the macro, making sure you understand what it is doing with each Action.

5 Likes

Very nice. I have a similar concept (app-specific palettes) that I do by assigning the same hot key to conflict palettes that are only available in the context of specific app(s). For example.

Since I'm discussing palettes here, I thought I'd pass on this tip I got from someone else (sorry can't remember who).

**EDIT: 2017-05-10  7:31 PM CT -- Sub-Palette Author**

* I found the source of my "idea":
* [Pallets & Sub-Pallets make KM so easy](https://forum.keyboardmaestro.com/t/pallets-sub-pallets-make-km-so-easy/6070) by @appleianer.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
###Use "Sub-Palettes"
* This is a made-up term.  
* KM does NOT technically have "Sub-Palettes".
* It simply means having a Macro in one palette that shows another palette, which I call the "Sub-Palette".
* The purpose is to keep the parent Palette short and simple, showing only your most often used macros.
* But then allowing you to see more Macros in a palette when you need to.

###Example:  Script Debugger

Using the macro I posted at the top of this topic, I have one Switch Case for "Script Debugger":

<img src="/uploads/default/original/2X/8/889de3b693720c9ae48d3bfb81b91b45d1af6889.png" width="431" height="158">

When I press ⌃⇧P while Script Debugger is frontmost, I see this:
<img src="/uploads/default/original/2X/0/0a5fbba63cb7dc0e591152fd494db6d99271a2aa.jpg" width="423" height="214">
The Action that displays this macro does so for "Show palette for one action".  If I wanted to keep showing it until I hid it, then I could have chosen the Action option "Show/Hide palette".

When I type "M" for "Main", I see the Sub-Palette:
<img src="/uploads/default/original/2X/5/5c227fcb9bce6e9efe98f0c122881ef5bf846faa.jpg" width="541" height="357">

Notice on this palette there are several Macros with a "typed string" trigger.
I can't always remember these.  Once this palette is showing I can see the "typed string", press ESC, and then actually type the string in SD to trigger the macro.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Again, this was not my idea.  Someone else suggested it, but it took me a while, with some experimentation, to understand how I could use it.  Once you see it in action, it becomes very obvious.

Of course, if you wish, each sub-palette could have a Macro that shows yet another sub-palette.

I hope you guys find this helpful.
3 Likes

JMichaelTX's macro at the top provided the approach I've been looking for as well in order to use a palette to simply remind me of my macros' triggers. Neither the Global Macro Palette or even a duplicate Macros Group Palette approach worked to my satisfaction! However, his macro offered the following approach, not based upon any specific application.

Keyboard Maestro “Display KM TextExpander Group Macros Palette” Macro

Display KM TextExpander Group Macros Palette.kmmacros (3.6 KB)

Many thanks to JMichaelTX and feedback welcomed.

1 Like

@KM_Panther, I'm glad you found my macro/technique helpful.

If I correctly understand your objective with your macro, it is to toggle the display of the palette on/off, right?

If so, then I think you can use the "Show/Hide palette" option to achieve this with one action. Each time I trigger the macro it toggles the palette on/off.

At least that's how it works for me.

JMichaelTX,

You’re absolutely right! I never checked the actions, but only worked from your macro.

Thanks for that feedback

1 Like

I have just updated my Macro to Ver 1.1 in the OP.
Please let me know if you find any issues.