Drill into groups
-- drill into groups of the current layer
-- to print all switch layers
function msRecipes:DrillIntoGroups(layer) if layer:IsGroupType() then local group = self.moho:LayerAsGroup(layer) for i = 0, group:CountLayers()-1 do local sublayer = group:Layer(i)
-- the actual drill down self:DrillIntoGroups(sublayer) end end -- this is where you do something
-- as an example I print switch layers -- putting this at the end prints children -- before parent
if layer:LayerType() == MOHO.LT_SWITCH then print(layer:Name())
end
end