Getting all the styles in a document?
Posted: Wed Sep 16, 2015 7:04 am
Perhaps it's a change in 10/11 or maybe it never worked this way, but I can't get a style to get called.
I see by the docs it *ought* to be:
moho.document:Style(id) or moho.document:Style(name) but trying to cycle through the styles I am getting nowhere with:
for i = 0, moho.document:CountStyles() - 1 do -- this returns count ok
local thisstyle = moho.document:Style(i) -- this returns nil
If I DO call it with a name it works (so moho.document:Style("Skin") returns a style if there is one named Skin). Doesn't help me much if I don't know the names in advance, though.
Anyone have a clue?
I see by the docs it *ought* to be:
moho.document:Style(id) or moho.document:Style(name) but trying to cycle through the styles I am getting nowhere with:
for i = 0, moho.document:CountStyles() - 1 do -- this returns count ok
local thisstyle = moho.document:Style(i) -- this returns nil
If I DO call it with a name it works (so moho.document:Style("Skin") returns a style if there is one named Skin). Doesn't help me much if I don't know the names in advance, though.
Anyone have a clue?