I have a single Page with many Artboards (let's say 10).
Some of these Artboards (n=5) have layers with name 'Pip'
I want to get all layers with name 'Pip' into an array from a specific Artboard, the currently selected one.
I assumed I could use the getLayersNamed('Pip') method on an instance of my current Artboard, but this didn't work:
const document = sketch.getSelectedDocument()
const selection = document.selectedLayers
const current_artboard = selection.layers.getParentArtboard()
const pips = current_artboard.getLayersNamed('Pip')
How can I go about populating my pips array?
I also want to do something like this for a single Layer that will only be in some of my Artboads.