if (selection.count >= 1) and (selection[1].modifiers[#MeshSmooth] != undefined) then selection[1].modifiers[#MeshSmooth].enabled = not selection[1].modifiers[#MeshSmooth].enabled I'll let Slum come up with the macro name, but that should be all the code required to toggle the modifier on and off.