How to "Tidy up Paths" with script?

Hey,

Is there a way to call the “Tidy up Paths” from the Paths menu via a script?

Cheers,
Johannes

1 Like

You mean the menu command?

Layer.cleanUpPaths()
1 Like

Perfect, exactly that!

It doesn’t seem to be documented, though.

Cheers!

It is part of the Core, not the wrapper:
https://docu.glyphsapp.com/Core/Classes/GSLayer.html#//api/name/cleanUpPaths

Oh wow. I just never even realized that there is that “Core” button… explains a few things :grimacing:

Thanks!

What you see in Core is what the PyObjC bridge provides directly. The functions listed in Core are Python translations of Objective C function names, hence not as ‘pythonic’ as a Python purist would expect.

Roger, I bumped into those with various code samples but just never seen where they are documented, hence assumed they are contributor knowledge or people had gotten them via code introspection :man_facepalming:

Well, that is partly true, though. Digging and poking in all directions can sometimes help as well :laughing:

1 Like