Shortcut or extension to toggle ALL trays on & off

I’m looking for a way to universally toggle (preferably with a shortcut key) the current state of visible all trays off & back on (hide & unhide).
I use multiple trays and even with 2 screens (SketchUp open on one screen & the trays on the other) they take up a lot of my available screen real estate keeping me from viewing anything else in the OS when SketchUp is the application in focus.

Thanks,
Chris

Have you tried clicking on the push pin icon in the upper right corner of the trays?

you can assign a shortcut to toggle the visibility of the trays.

tray

1 Like

Hey y’all yes I was already doing both of those things but thanks the suggestions. If I could create a shortcut key that toggled them all off or on that would be awesome - Photoshop has this capability and it’s greatness!

Thanks again.
-Chris

Did you see @Jefke123’s screen shot. You can create a keyboard shortcut.

The SketchUp Ruby API does not expose anything specific to the tray system.
But (on Windows editions) we can use automation IDs if we know them.

On my machine their command IDs are sequentially numbered beginning 10640 (for the Default tray.)

I do not use the Default Tray myself, only 6 other custom named trays.
(I do not rename the Default tray even though it is possible, it causes a bug.)

So if I were to write a command for myself it’d be …

UI.menu("Window").add_item("Toggle ALL Trays") {
  for t in 1..6
    Sketchup.send_action(10640+t)
  end
}

This puts a menu item in the Window menu that can be assigned a single shortcut (key or combination.)


Tested and there are some interesting behaviors.

Two of my trays are collapsed into the left margin, …
HELP (with the Instructor panel,) and TREE (with the Outliner panel.)

When they are collapsed their toggle does not do anything.

For the other 4 that are stacked in a docked pane on the right, the one that is active after toggling back on, is the one highest in number (regardless of which one was active when they were toggled off.)

I do not want this, I want my #3 tray PROPERTIES (with the Entity Info panel) to be the active tray after toggling back on.

So for me I’d likely just list the IDs in the order I wished them to toggle off and back on.
Which is …

UI.menu("Window").add_item("Toggle ALL Trays") {
  6.downto(3) do |t|
    Sketchup.send_action(10640+t)
  end
}