There’s a little bit of zscript gymnastics necessary to get this to work. First of all you need to take note of the points that TVeyes makes in this thread: http://www.zbrushcentral.com/showthread.php?157182-script-request-toggle-record-off-and-bake-all-for-ALL-subtools.
Once you have made sure that the Layer you want is positioned (using the scrollbar) at the top of the list you can use this code:
[VarSet,layerPath,[StrMerge,“Tool:Layers:”,[IGetTitle,“Tool:Layers:Layer Intensity”]]]
//turn on Layer recording if necessary
[VarSet,wid,[IWidth,layerPath]]
[If,([IModGet,layerPath]&1) != 1, // if record mode is OFF
//set Intensity to 1 for recording
[ISet,Tool:Layers:Layer Intensity,1]
[IClick,layerPath,wid-28,5] // turn on recording by clicking the REC icon
]
Basically the code simulates a click of the Record icon. You have to get the width of the Layer list so that the click is in the right place (this will vary with the user’s setup). Setting the Layer Intensity to 1 is not necessary but it does give a visual reminder that all recording is done at an intensity of 1.
HTH,