Reporter Plugin _scale error

Hi There!

I’m starting a new Glyphs 3 Reporter plugin, based on the template provided in the Glyphs 3 repo.

When this code (provided in the documentation) is called:

NSColor.controlTextColor().set()
NSBezierPath.fillRect_(layer.bounds)
self.drawTextAtPoint(layer.parent.name, NSPoint(0, 0))

I receive this error message (in the macro output window):

Traceback (most recent call last): File "GlyphsApp/GlyphsApp/plugins.py", line 1309, in drawTextAtPoint File "GlyphsApp/GlyphsApp/plugins.py", line 1345, in getScale AttributeError: 'SampleReporter' object has no attribute '_scale'

Am I right in thinking this underscore-prefix function has something to do with the PyObjC wrapper for the API?

Any idea what is causing this error? @GeorgSeifert @mekkablue

Thanks!

Additionally, for what its worth, the NSBezierPath.fillRect_(layer.bounds) call doesn’t seem to be drawing anything to the screen at all.

I also have the ReporterToggler plugin installed, and it doesn’t list this new reporter plugin I’m working on, in that list.

Are these issues all related somehow?

Where are you calling these functions?

In order for your plugin to be listed properly, you need to edit the appropriate fields in the info.plist file (this is covered in the tutorial on plugins).

Note, you don’t need to ping Georg and Rainer in every post :wink:

Are you referring to the CFBundleName within the plist file?

Not sure, exactly. Just check that the principal class name matches your plugin class name and that there are no typos otherwise.