AttributeError of Filter offsetCurve

def filter(name):
        for filter in Glyphs.filters:
                if filter.__class__.__name__ == name:
                        return filter
offsetCurveFilter = filter('GlyphsFilterOffsetCurve')
mylayer = Glyphs.font.glyphs["X011"].layers[0]
offsetCurveFilter.filter(mylayer, False, {"OffsetCurve;15;10;0;0.5;"})

This script report the AttributeError: ‘GSMenu’ object has no attribute ‘filterInstances’
Please help check the reason.
My Glyphs version is 2.6.5(1325)
Thanks.

Fixed it. Thanks.

Thanks.
Need I download the newest version of Glyphs and install it again?

I need to finish an update. Will take some time. Maybe later today, or tomorrow. Then you update the app.

After I updated to version 1329, but now report another error as below:
AttributeError: ‘GlyphsFilterOffsetCurve’ object has no attribute ‘filter’
Thanks.

Hi, i have the same problem:

(the other method works for all layers but it’s not possible(or i can’t) select a specific layer)

I couldn’t call the other filters via the same naming structure (i tried for Hatch Outline filter), where i can find the names?

please help. this is very important for me.
i want an iterate-able method to apply filters to a glyph list via script(not for use in app, but as a part of build script via python api), so if there is any other solution, please let me know.

the GlyphsFilterOffsetCurve filter can be used like this:

import objc

layer = Layer
offsetX = 10
offsetY = 20
makeStroke = True
autoStroke = False
pos = 0.5
metrics = Layer.metrics
capStyleStart = 0
capStyleEnd = 0
keepCompatible = False

GlyphsFilterOffsetCurveClass = objc.lookUpClass("GlyphsFilterOffsetCurve")
GlyphsFilterOffsetCurveClass.offsetLayer_offsetX_offsetY_makeStroke_autoStroke_position_metrics_error_shadow_capStyleStart_capStyleEnd_keepCompatibleOutlines_(layer, offsetX, offsetY, makeStroke, autoStroke, pos, metrics, None, None, capStyleStart, capStyleEnd, keepCompatible)

it’s working! thank you :slight_smile:

how about the other filters? it seems there is no access to them like that. i tried GlyphsFilterHatchOutline (the same naming structure)and Glyphs raise this error:

objc.nosuchclass_error: GlyphsFilterHatchOutline

This one is “HatchOutlineFilter”.

great. thanks again :))