Exporting layers?

Try this as a starter:

from GlyphsApp import *

myFont = Glyphs.font
selectedLayers = myFont.selectedLayers

fill(0.5, 1.0/len(selectedLayers)) # set color

for thisLayer in selectedLayers:
    # draws paths:
    drawPath(thisLayer.bezierPath)
    
    # draws components:
    for thisComponent in thisLayer.components:
        drawPath(thisComponent.bezierPath)

When you call the bezierPath object of a layer, components are ignored. That is why there is an extra loop just for components.