Page 1 of 1

Query available Layer Comps in a file

Posted: Tue Oct 20, 2015 7:17 pm
by ernpchan
Is there a way to get the list of Layer Comps that are in a file?

Re: Query available Layer Comps in a file

Posted: Tue Oct 20, 2015 11:43 pm
by dkwroot
I haven't tested this code, but I believe it goes something like this...

Code: Select all

Doc = moho.document
for i in Doc:CountLayerComps()-1 do
   Comp = Doc:GetLayerComp(i)
   print(Comp:Name())
end

Re: Query available Layer Comps in a file

Posted: Wed Oct 21, 2015 12:11 am
by ernpchan
Eh, after seeing this was in the MohoDoc section in aslua.com I shoulda been able to figure this out. :oops:

I gotta get my head wrapped around lua/ASP's scripting doc to avoid such noob questions.

Thx dkwroot.

Re: Query available Layer Comps in a file

Posted: Wed Oct 21, 2015 12:21 am
by ernpchan
Just in case others ask, this is the proper syntax.

Code: Select all

    Doc = moho.document
    for i = 0, Doc:CountLayerComps()-1 do
        Comp = Doc:GetLayerComp(i)
        print(Comp:Name())
    end

Re: Query available Layer Comps in a file

Posted: Wed Oct 21, 2015 10:43 am
by hayasidist
Thanks guys -- ASLua updated with this info.