I’m currently writing a script to switch off all but the currently selected sub tools.
So far so good - only I can’t figure out how to do that by index instead of by name
Here’s what I have so far:
// Switched off all but current sub tools
[IButton, "Switch off", "Switch off all but selected sub tools",
// create variable equal to number of sub tools
[VarDef, len, [SubToolGetCount]]
// get active index of tool
[VarDef, idx, [SubToolGetActiveIndex]]
// loop over array
[VarSet,i,0] [Loop,len,
// Not sure if you have to select as you go
// but i'm not sure how to get the subtool name
[SubToolSelect,[Val,i]]
[VarSet,subtoolName,[IGetTitle,Tool:Subtool:Item Info]]
[If, i == idx
, // Then...
[Note, idx] // idx is correct
// Try to switch off
//[IModSet,Tool:SubTool:subtoolName,1] // doesn't work ???
// this works by name ie "head" "heart" "eyeball"
// [IModSet,Tool:SubTool:Heart,1]
, // Else...
// Do nothing
] // end if
[VarInc, i] // i++
] // end loop
] // end button