like CurrentGlyph() but for the current layer (or master) at least?
def CurrentLayer():
"""Return a RoboFab glyph object for the currently selected layer."""
Doc = Glyphs.currentDocument
try:
Layer = Doc.selectedLayers()[0]
return RGlyph(Layer)
except: pass
print "No glyph selected!"
return None
Returns this error though:
File "~/Library/Application Support/Glyphs/Scripts/objectsGS.py", line 426, in __init__
_GSGlyph.setLayer_forKey_(self._layer, self._layerID)
AttributeError: 'NSKVONotifying_GSLayer' object has no attribute 'setLayer_forKey_'
I’d like to do this so I can make my Robofab pen script work across different masters.