Not a wizard with code, and I’m essentially hacking an existing plugin that we have that changes styles from dark to light theme.
Currently, the plug-in swaps theming/styles for ALL objects in the current page using:
Figma.currentpage.findall()
It swaps styles for basic objects, to complex components, frames, etc everything and walks thru all the child objects - that is all good.
I want it to work on the current selection , so I changed the code to:
Figma.currentpage.selection
This works, but ONLY for parent objects - circles, squares, frame background colours, but nothing nested - does not work on objects within groups, within frames or components.
I “think” this is related to what the selection returns and how it is organized compared to what findall returns?
The rest of the function works fine and steps thru findall, but doesn’t iterate through child objects.
Probably a very elementary question, but any help would be great.
Thanks,
-damian