You might want to make a macro that will only work if you are working in a specific application. To do this, edit your macro so that it looks something like the following. In this example we'll pretend you only want the macro to run if you're working in Microsoft Word.:
GetActiveWindow>title,X,Y
Pos>Microsoft Word,title,1,StPos
If>StPos=0,end
..
.. Your Macro Here
..
Label>end
So, you surround your existing macro with the lines above. The macro determines if the current window is Microsoft Word, and if not jumps to the end of the script.