ZBrushCentral

new to zscript

hi, I can’t make this work.
the “toolz” variable works fine with Note command, but not with the IPress command, it looks for the tool named toolz.
thanks.


[VarSet,toolz,[IGetTitle, Tool:ItemInfo]]
[IButton,"Test Edit","Test Edit button for its State", //beginning of button code 
 
[Note,toolz,,3] //displays the value of Edit button for 3 seconds 
 
[IPress,Tool:ZSphere]
[IPress,Tool:toolz]
] //end of button 
 

it doesn’t work either

 [IPress,[StrMerge,"Tool:",#toolz]]

Using IGetTitle from the Item Info slider returns the name of the item but with a period [.] at the end. You need to take that off:


[VarSet,toolz,[StrExtract,[IGetTitle,Tool:Item Info,0],0,[StrLength,[IGetTitle,Tool:Item Info,0]]-2]]

Other than that, using StrMerge, as in your second post, is the way to go.
EDIT: using non-zero as the IGetTitle arg will yield the full button path. This would work without the StrMerge for default ztools but for tools loaded from disk the file path is returned which will cause an error.

HTH,

thanks for the reply,
however it doesn’t work yet, I’ll check again when I have time.
greetings.