You can use [IGetTitle] to get the subtool name then use [StrMerge] to create the subtool path. See here:
Code:
[VarDef,subTName,""]//defines variable as empty string
[VarDef,subTool(1024),0]//defines a list variable to hold visibility (0 = off, on = 1)
[VarSet,totalSubTools,[SubToolGetCount]]//the total number of subtools
[VarSet,activeSubT,[SubToolGetActiveIndex]]//record the active subtool
[If,activeSubT==0,[SubToolSelect,1]]//this stops an error if the top subtool is selected but hidden in the list
[Loop,totalSubTools,
[SubToolSelect,[Val,n]]//selects the subtool by number
[VarSet,subTName,[IGetTitle,Tool:ItemInfo]]//gets the tool name
[VarSet,subTName,[StrExtract,subTName,0,[StrLength,subTName]-2]]//trims off period at the end
[If,[IModGet,[StrMerge,"Tool:Sub Tool:",#subTName]]>=16,
[VarSet,subTool(n),1]//visible
]
,n]
[SubToolSelect,activeSubT]//return to the active subtool
Note: this example uses commands introduced in ZBrush 4R4 and not available in earlier versions.