Deactivate a Single Macro Based on the Computer Name?

I'm syncing KM across several computers. Some Macros that use the screen size of my desktop won't work properly on my laptop, but they get sync'ed to the laptop anyway.

Is there a way to deactivate a single macro based on the name of the computer? I saw how to do this to a whole folder of macros, but not just a single one.

If not, can I use the computer name as a test for a conditional, so it would decide which part of the macro to run, based on which computer was running it?

Thanks.

Yes. See below macro which uses the token %MacName%

The Set Variable to Text is just so you can see the name of your mac.

This launches when you start up the Keyboard Maestro Engine, which should be any time you log in to your Mac.

###OR

You could you could just add this IF/THEN Action to each macro concerned.

2 Likes

This was very helpful to me, thanks for posting it (four years ago!).

Another alternative approach:

As I was adding this to a long existing macro, and I didn't want to re-nest everything in an IF/THEN clause, I came up with the alternative below. This checks MacName and aborts the whole macro if it's not running on the correct computer. This was easier to insert into what I already had.