I had a script that simply deleted all paths in selected glyphs on the selected layer. Do not remember who is the owner or if I modified an existing script but it did the job well. Now when I’m trying to run either this script or any other script from glyphs repository (different owners) that includes deleting paths (either on foreground or background layers), I’m getting this error message
TypeError: 'GSProxyShapes' object doesn't support item deletion
Here is the code I’m trying to get working:
Font = Glyphs.font
selectedLayers = Font.selectedLayers
def DeleteAllPaths( thisLayer ): thisLayer.parent.beginUndo() for i in range( len( thisLayer.paths ))[::-1]: del thisLayer.paths[i] thisLayer.parent.endUndo() Font.disableUpdateInterface() for thisLayer in selectedLayers: DeleteAllPaths( thisLayer ) Font.enableUpdateInterface()
Running it in the Macro window so there no import GlyphsApp etc in the beginning.
I know it looks very amateur, sorry about this. The last time I pretended to be a programmer/developer was 25 years ago in the uni.