Help - macro toggle between two commands

Hi, i’ve never scripted anything in rhino, but i would like to know if there is a way for me to create a macro that alternate between two commands e.g. 2 display mode or align the gumball to world/object

For the two you mentioned above, toggling with a macro, no… you would need a small script. You can only set one or the other with two different macros. Basically anything where there are more than two choices can’t be ‘toggled’ via macro, because you need to deal with an “if” condition, which only scripted logic can provide.

Most Rhino options that have only two options can already be toggled with a macro. Otherwise both of your commands could be handled by a small custom script.

Is there somewhere i can find an example of a script like the one you described?