If you have any problems writing macros, you can get help from a number of places.
And last but not least, you can ask Keyboard Maestro itself for assistance by choosing Assistance from the Help menu.
In particular, the Assistance window can help you:
if something is happening that you do not expect, Keyboard Maestro can show you what it is doing.
if a macro is not doing anything, Keyboard Maestro can help you to learn why.