Scripting with addNodesAtExtremes()

Hi!

I am trying to add extremes to selected segments via a script. (I understand it’s possible to do this with a shift click, as mentioned previously on this forum, but was curious if there was a way to do this via a script.)

I noticed that we have the addNodesAtExtremes() method both on the Layer and Path objects — while the documentation states that there is a checkSelection parameter, when I pass in this second parameter, it gives me the following error:

Path_addNodesAtExtremes() takes from 1 to 2 positional arguments but 3 were given

Is it possible that it’s currently setup to only allow the force parameter? What’s the proper syntax to check for selected segments when adding extreme points?
Any tips would be very helpful.
Thank you!

You’re right, it seems like the checkSelection parameter has not been implemented.

print(help(GSPath.addNodesAtExtremes))
print(help(GSLayer.addNodesAtExtremes))

Output:

Help on function Path_addNodesAtExtremes in module GlyphsApp:

Path_addNodesAtExtremes(self, force=False)

None
Help on function Layer_addNodesAtExtremes in module GlyphsApp:

Layer_addNodesAtExtremes(self, force=False)

None

Thanks, @justinpenner for confirming this! Rainer/Georg, is there a plan to support this in the future?

It is implemented in version 3.2.

Got it, good to know. Thank you Georg!