I suppose the easiest might be to just save a file with that setup as a template and then use a button to read the viewports from that file.
Else you’ll have to use SetActiveViewport to tell which viewport you are changing shading, … to.
Thank you very much, where/how have you acquired this knowledge? It would be nice for me to be able to figure these relatively simple things out myself without having to “bother” you guys with it every time.
@Peter, glad I could help.
You are building macros so you can find useful information in Rhino Help under Command Macros and Scripting.
Basically, whenever a command opens another window (dialog box with command options or to browse for a file or path) you can use hyphen before command name to suppress this window and move stuff to command line. This allows you to build text macros.