Get selection from layers panel

Is it possible to get the list of the layers selected on the layers panel?

There is no “good” way to get to it. What are you trying to do?

panels = Glyphs.font.parent.windowController().panelSidebarViewController().valueForKey_("paletteInstances")
layerPanel = None
for panel in panels:
	if panel.__class__.__name__ == "GlyphsPaletteLayers":
		layerPanel = panel
		break
if layerPanel:
	print(layerPanel.allSelectedLayers_(layerPanel.layersList().selectedRowIndexes()))
1 Like