i am new to Max-Scripting i wrote this, whts wrong here.i want to select first layer after that second and so on.... it showing error.
totalLayers = LayerManager.count - 1
for i = 0 to totalLayers do
layerNames = format "%\n" (LayerManager.getLayer i).name
for each in layerNames do
layer = LayerManager.getLayerFromName each
layer.current = true