Parsing folder-layers, a little help please.
Posted: Fri Jan 23, 2009 12:11 pm
I'm working on a script that parses folder-type of layers for all it's child layers and I've got it partially working.
The following code works when running it on a Switch layer but on all other kind of folder-layers I get the lua-error;
So, why does CountLayers() only work for switch-layers? and how can I get the folder parsing to work otherwise?
The following code works when running it on a Switch layer but on all other kind of folder-layers I get the lua-error;
Code: Select all
... attempt to call method 'CountLayers' (a nil value)
Code: Select all
local parent = moho.layer
local numberlayers = moho.layer:CountLayers() --Here's the line lua has troubles with.
local j = 0
--parse through all child layers
for i= 0, numberlayers - 1 do
moho:SetSelLayer (parent:Layer(j))
print (moho.layer:Name())
j =j+1
end
end