How to toggle a docked panel?

I have one docked panel on the right side of the screen. It contains four tabs, “Properties,” “Layers,” “Notes,” and “Calculator.” Would it be possible to create a toolbar button script or macro to toggle this panel On and Off, showing the same four tabs when toggled back On? Thanks.

You can Make a button with left mouse button:

-_calc _s -_properties _V _yes _enter -_layer _V _yes _enter -_notes _v _yes _enter

and right mouse button

   -_calc _h -_properties _V _no _enter -_layer _V _no _enter -_notes _v _no enter


Thank you for a great answer. I’ve tried numerous variations of this, but they ultimately showed a couple tabs docked and a couple in floating panels. A problem I had with my prior attempts, and with this one, the right button would not hide the “Properties” tab every second time I toggled the panels off. So I appended a second “- _properties _V _no _enter” to the end of the right button macro. Everything working good!

PS: I hastily pasted the code over my existing code, and lost the command that stops the visual updating until the end of the macro, then turns updating back on again. Any idea what this command is? I’m having a senior moment.
Thanks again.

Do you mean SetRedrawOff and SetRedrawOn?

I think so. Thanks again.

Your macro is working well. One thing that prevented my prior attempts was putting the commands on separate lines. Having all the commands on one line prevents the panels from reappearing as floating panels. It doesn’t make sense to me, but something I’ll remember when things aren’t going as expected.