Well, there are some regular folders that you could search easily enough. Then if you didn’t find the material there you could inform the user and get them to select the material from disk (you could use FileNameAsk for that). The code below shows you the idea. Note that LightCaps are a bit more tricky though…
[VarDef,gStartupFolder,“ZBRUSH_ZDATA/Materials/Startup/”]
[VarDef,gMatcapFolder,“ZBRUSH_ZDATA/Materials/MatCap/”]
[VarDef,gUserFolder,“ZBRUSH_ZSTARTUP/Materials/”]
[VarDef,gLightboxFolder,“ZBRUSH_ZMATERIALS/”]
[IButton,“Reset mat”,“Reset the current material”,
[VarSet,lCurrentMat,[StrMerge,[IGetTitle,Material:Current Material],".zmt"]]
[VarSet,loadOK,0]
[Loop,1,
[VarSet,mat,[StrMerge,gStartupFolder,lCurrentMat]]
[If,[FileExists,mat],[VarSet,loadOK,1][LoopExit]]
[VarSet,mat,[StrMerge,gMatcapFolder,lCurrentMat]]
[If,[FileExists,mat],[VarSet,loadOK,1][LoopExit]]
[VarSet,mat,[StrMerge,gUserFolder,lCurrentMat]]
[If,[FileExists,mat],[VarSet,loadOK,1][LoopExit]]
[VarSet,mat,[StrMerge,gLightboxFolder,lCurrentMat]]
[If,[FileExists,mat],[VarSet,loadOK,1][LoopExit]]
]
[If,loadOK,
[FileNameSetNext,mat]
[IPress,Material:Load]
,//else not found
[Note,“Material not found. Please load file from disk”]
]
,1]