Created
October 4, 2017 09:42
-
-
Save weiweihuanghuang/f018b368d8188f491944a5a72b414bc8 to your computer and use it in GitHub Desktop.
Move Selected Up 10u
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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