How to create an application specific macro

As the title of this post implies, I would like to know how to create macros that will only run within a specific application. Possible?

Thank you

If you create (and select) a macro group for a specific app in the left hand panel of the KM Editor

You can then set its availability properties in the right hand panel

1 Like

Actually I think I found it:

But now I’d like to know if there’s a way to do this within a macro itself. I would want to do this because often times I like to organize my macros by project not by application.

Thanka.

@ComplexPoint:

Thanks for your reply, I did find how to do what you suggested (see my other reply) with the additional question.

Thanks again!

If you do this in general you are working against how KM is designed to work, I think.

You can make a macro application-specific by itself, for example with an If…Then action. But this means the macro will start every time no matter which application you are in, since it has to check for the condition. Doing this for every application-specific macro will certainly not be very economic.

By the way, instead of searching for solutions on the web or on StackExchange, in most cases it will be more efficient to search the KM Wiki first. The KM Wiki is linked from the Help menu of KM Editor. (There you find also many other useful links.)

The macro itself can detect which application it is in and do different things. Generally this is not as good as using a Macro Group to limit the macro because it means the macro is now available everywhere so the macro cannot "do nothing" (it can perform no actions, but it will still swallow the hot key for example).

You can handle multiple applications using the Switch or Case action as described here:

1 Like

As @peternlewis suggested, you can use the Switch Case Action.
I have just uploaded an Action for this, complete with instructions. See:
###ACTION: Switch Case Based on FrontMost App