How to update broken handle with script?

It is possible to aligned the vertical handle with it’s segment by script ?
Moving the point by hand fix the problem, but I would like to automate this .

Capture d’écran 2023-01-25 à 14.17.23

This should work, when the green node is selected:

node = Layer.selection[0] # selected smooth node
node.parent.setSmooth_withCenterNode_oppositeNode_(node.prevNode, node, node.nextNode)

prevNode and nextNode depend on which node is supposed to align

1 Like

That’s exactly what I was looking for, thanks @alexs !