I want a macro that closes both trays with one button.
I found this script on the forum that Marcus wrote.
It closes or opens both trays with one button, but its not working with ZB 2019
I thought it was due to the double clicking now used to open / close trays. I tried to alter it to work, but could not get it to work. Can any one show me how it might be done ? Thanks.
//ZBRUSH MACRO - save file to ZStartup/Macros/Misc folder
[IButton,???,“Toggle trays open/closed”,
//create memory block to store tray states if necessary
[If,[MemGetSize,ToggleTrays_Mem],
[MVarDef,ToggleTrays_Mem,1,3]
]
[IFreeze,
//check tray states
[If,(([IHPos,1000]>0)||([IHPos,1001]+[IWidth,1001]<[IWidth,Title])),//if either tray is open
[MVarSet,ToggleTrays_Mem,0,0]
[If,[IHPos,1000]>0,//the left tray is open
[MVarSet,ToggleTrays_Mem,0,1]
[IClick,1000]
]
[If,[IHPos,1001]+[IWidth,1001]<[IWidth,Title],//the right tray is open
[MVarSet,ToggleTrays_Mem,0,[MVarGet,ToggleTrays_Mem,0]+2]
[IClick,1001]
]
,//else both trays are closed so open them as required
[If,(([MVarGet,ToggleTrays_Mem,0]==1)||([MVarGet,ToggleTrays_Mem,0]==3)),//open left tray
[IClick,1000]
]
[If,([MVarGet,ToggleTrays_Mem,0]>1),//open right tray
[IClick,1001]
]
]
]
,.5]//button half palette width