Show macro in a palette conditionally?

I can think of at least two ways of handing this use case. Both of these are just UNTESTED, probably INCOMPLETE, ideas.

  1. Use Common Macro Group (MG) with Custom MGs
    • Create a common MG that contains all the Macros that will always be shown in the palette.
    • Do NOT set this MG to display a palette
    • Create separate MGs for each use case (PDFs, PlainText, etc)
      • Add a "Macro alias" for each Macro in the Common MG
      • Add a Macro for each specific choice for this use case
        (i.e. one real Macro for each PDF function)
    • Create a Master Macro that evaluates the App's menus and then Shows a palette from the proper MG
      • You could trigger this Master MG either by hotkey, or with an App Activates trigger.
        .
  2. Put All Macros in the Same MG, and Enable/Disable as needed
    • Enter all of the Common Macros as enabled
    • Enter all of the menu specific Macros as disabled
    • Create a Master Macro that enables the proper Macros, and disables the other macros, and then shows the palette

Approach #2 would be slower, since it takes more time to enable and disable Macros.
To create a "Macro Alias", see MACRO: Make Macro Alias by @DanThomas.

Hope you find these ideas helpful.