The scope for macros can be defined at the Group level:
Is it possible to define the scope at a single specific macro level?
The scope for macros can be defined at the Group level:
Is it possible to define the scope at a single specific macro level?
If you put the single specific macro into its own group, then clearly yes, otherwise I don't think so.
One option would be add an If action at the beginning of the macro, add whatever application or window conditions you need, and if they don’t return true have the macro self cancel. Obviously it won’t keep the macro from triggering but it will prevent it from actually doing anything.