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 Help ➤ Interactive Help menu.
In particular, the Interactive Help window can help you: