"global name 'Glyphs' is not defined" in Reporter

I get this problem for the following function:

def drawLayerOpenOrClosed( self, Layer ):
	try:
		if Glyphs.defaults["showBackground"] == True:
			if len( Layer.background.paths ) > 0:
				try:
					self.bezierPathComp(Layer.background).stroke()
				except:
					pass # Layer.bezierPath() is None

				try:
					Layer.background.openBezierPath().stroke()
					# sometimes leaves traces (ghost paths) after deletion
					# the if statement above should fix this
					# please report if ghost paths still occur
				except:
					pass # Layer.openBezierPath() is None
	except Exception as e:
		self.logToConsole( "drawLayerOpenOrClosed: %s" % str(e) )

I don’t understand why it’s a problem?

Did you

import GlyphsApp

at the top of the file?

yeps

Can you send me the plugin?

What was happening here btw?

I’m actually getting this another script too?

You might need to do this:

from GlyphsApp import Glyphs

Ah, I’ll try that