Created
June 23, 2012 16:44
-
-
Save anonymous/2978968 to your computer and use it in GitHub Desktop.
Background to Foreground
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
#MenuTitle: Background to Foreground | |
# encoding: utf-8 | |
# [h] Back to Fore | |
selectedLayers = [ x for x in Glyphs.currentDocument.selectedLayers()] | |
for layer in selectedLayers: | |
back = layer.pyobjc_instanceMethods.background() | |
#Remove all old ones | |
for i in range(len(layer.paths)): | |
try: | |
layer.pyobjc_instanceMethods.removePathAtIndex_(i) | |
except: | |
pass | |
for i in range(len(layer.paths)): | |
try: | |
layer.pyobjc_instanceMethods.removePathAtIndex_(i) | |
except: | |
pass | |
#Copy paths from back | |
for zzz in back.paths: | |
layer.pyobjc_instanceMethods.addPath_(zzz) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment