Is it possible to use a script to open and menu so a menu toggle can be made?

Im trying to make a script that open a menu like tool but then another menu like brush if pressed again while open, I cant seem to get it to work.

//ZBRUSH MACRO - Recorded in ZBrush version 4.73
[IButton,???,“Press to run this macro. Macros can be aborted by pressing the ëescí key.”,
[If,[IGet,Tool] == 1,

I tried [IShowActions,1] or removing still wont show the action of bring up menu

Love the spacebar and hot keys for that… Is this to be a part of something bigger?

Yes, I have alot Menu/Custom menus on hotkeys and trying to save space/time by making based on how many times i click the hotkey

1ft Press = Tools Menu
2nd Press = Brush Menu
3rd Press = Alpha or Stroke Menu

You can use [IShow] to show a palette at the cursor position. If the palette is in the right or left tray then it will be opened there instead (or if it’s already open, nothing will happen).

This will cycle through three palettes as you press the hotkey. You could extend it to more palettes easily enough but make sure to use the loop otherwise it will just show the last palette (having quickly run through them all).

[IButton,???,“Use hotkey to cycle palettes at cursor”,
















]//end loop
]//end button

A note about hotkeys with macro or plugin buttons: if your hotkey includes a modifier key such as SHIFT you need to repress it for repeat presses - it won’t work if you hold it down and just press the other key. For example, if your hotkey is SHIFT+Q you’ll need to press both keys each time.

Thanks Marcus this works prefect your a life saver! :smiley:

Hi it sounds interesting… but could you explain it also a bit more to Scripting newbies, how it works, how it looks, what it is?

Why I am asking: I’m looking for a better workflow - I would like to have a more intuitive control over the menues of subtools, geometry, polygroup, masking and so on.
It’s a terrible scrolling (which also means to have to leave the canvas) because they all are from the Tools palette and you never can have them all open at the same time.
I also did not find a way to just grab the Subtools menue (only buttons can be customized as far as I know?) on the left side and any other menue from Tools on the right side (for example).


I’m looking for the same thing! Would like to open sub palettes like split, merge, project, etc…

All this does is show the main palettes at the cursor or in the trays. It’s not possible to show a sub-palette in the same way. So, for example, it’s not possible to script a way to have the SubTool palette pop-up at the cursor, or to isolate the SubTool palette from the main Tool palette. It’s a real shame but it’s just not possible.

If you want to have more than one sub-palette open then you can Shift+click them when you open them. It’s even possible to script this as I show in this thread but that’s about the limit of what you can do.

@marcus_civis ahh that\s unfortunate. No worries though, I guess will just create a copy of whatever subpalette’s I need and hotkey it that way. A little messy but should get the job done!