def executeAndReport(kernStrings): # brings macro window to front and clears its log: Glyphs.clearLog() Glyphs.showMacroWindow() # print status and modify Sample Texts: print("Adding %i lines to Sample Texts..." % len(kernStrings)) if not addToSampleText(kernStrings): print("Warning: could not add the lines.") else: print("Done.")
# MenuTitle: Increase Kerning # -*- coding: utf-8 -*- __doc__ = """ Uses modifier keys to adjust the kerning. """ from AppKit import NSEvent from GlyphsApp import Glyphs Glyphs.clearLog() # Glyphs.showMacroWindow() # --- From mekkablue --- keysPressed = NSEvent.modifierFlags() shiftKey = 131072 controlKey = 262144 optionKey = 524288 commandKey = 1048576 shiftKeyPressed = keysPressed & shiftKey == shiftKey controlKeyPressed = keysPressed & controlKey == controlKey optionKeyPressed = keysPressed & optionKey == optionKey commandKeyPressed = keysPressed & commandKey == commandKey # --- def get_current_glyphs(): g1 = Glyphs.font.currentTab.layers[Glyphs.font.currentTab.layersCursor - 1].parent g2 = Glyphs.font.currentTab.layers[ Glyphs.font.currentTab.layersCursor].parent return g1, g2