Skip to content

Instantly share code, notes, and snippets.

Created June 23, 2012 16:44
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 anonymous/2978968 to your computer and use it in GitHub Desktop.
Save anonymous/2978968 to your computer and use it in GitHub Desktop.
Background to Foreground
#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