I’m trying to write a simple macro to shift nodes from certain coordinates. After reading the scripting tutorials my understanding of Python in general and Glyphs macros specifically is still very limited, so I need some help with this. I figured out how to move the nodes I need, but it only moves the nodes themselves, the handles stay where they were. I circumvent this by declaring the handles for a second loop, but I’m sure there is a more elegant solution. This is my code so far:
for thisLayer in mylayers:
for thisPath in thisLayer.paths:
for thisNode in thisPath.nodes:
if(thisNode.y)==512:
thisNode.y = (thisNode.y + 10)
for thisLayer in mylayers:
for thisPath in thisLayer.paths:
for thisNode in thisPath.nodes:
if(thisNode.y)==546:
thisNode.y = + (thisNode.y + 10)
Thanks in advance!