I tried to create a script to manage styles in a document, but it seems impossible... I wanted to create a script that does this:
- Loop through all shapes in all layers
- Check if layer has a 2nd assigned style
- If it doesn't, create a style based on the shapes colors (if that style doesn't already exist)
- Set that newly created style (or existing style with matching colors) as the 2nd assigned style for the shape
I intend to use the 1st assigned style for a Brush-style for the entire project, and use the 2nd style for colors only.
I've tried some stuff with moho:AddStyle(style), but the style to give as argument can not be created? I can use the style of a shape as an argument (after setting its fName property), but that gives really weird results and crashes, because the style will be linked to the shape even though that shape doesn't even have that style assigned.
Do I need to do something similar to this?
Code: Select all
local vector2 = LM.Vector2:new_local()