macroScript AutoMat category:"HowTo" ( local AutoMat_Enabled on isChecked return AutoMat_Enabled on Execute do ( if AutoMat_Enabled == undefined then AutoMat_Enabled = true else AutoMat_Enabled = not AutoMat_Enabled if AutoMat_Enabled then ( txt = "if superclassof meditmaterials[1] != texturemap do /n" txt +="selection.material = meditmaterials[1]" callbacks.addscript #selectionSetChanged txt / id:#AssignMaterial persistent:false ) else ( callbacks.removescripts id:#AssignMaterial ) updateToolbarButtons() )--end Execute )--end macroScript