Skip to content

Instantly share code, notes, and snippets.

@weiweihuanghuang
Created October 4, 2017 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weiweihuanghuang/f018b368d8188f491944a5a72b414bc8 to your computer and use it in GitHub Desktop.
Save weiweihuanghuang/f018b368d8188f491944a5a72b414bc8 to your computer and use it in GitHub Desktop.
Move Selected Up 10u
import GlyphsApp
yDiff = 10
Font = Glyphs.font
Doc = Glyphs.currentDocument
selectedLayers = Font.selectedLayers
selectedLayers = [ l for l in selectedLayers if hasattr(l.parent, 'name')]
Font.disableUpdateInterface()
for thisLayer in selectedLayers:
selection = thisLayer.selection
for thisNode in selection:
thisNode.y += yDiff
for thisComp in thisLayer.components:
newPosition = NSPoint( thisComp.position.x, thisComp.position.y + yDiff )
thisComp.position = newPosition
Font.enableUpdateInterface()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment