Writing nested dictionary to Glyphs.defaults crashes Glyphs

Hi, I am trying to utilise the Glyphs.defaults feature for a script. My script requires a nested dictionary to read the preferences. Sadly, when I try to write a nested dictionary to Glyphs.defaults[com.my_name.etc], Glyphs immediately crashes.

When I do this manually in the Macro panel like this:

Glyphs.defaults["com.eweracs.my_script.prefs"] = {"Test1": {1: 2}, "Test2": {2: 1}}

I get:

Traceback (most recent call last):
File “”, line 1, in
File “GlyphsApp/GlyphsApp/init.py”, line 574, in setitem
ValueError: NSInvalidArgumentException - Attempt to insert non-property list object

(the bolds are of course with double underscore).

Any way I this can be fixed? Or do I need to rewrite my script method completely? :grimacing:
Thank you!

Aha, interestingly, it works with lists inside of the dictionary:

Glyphs.defaults["com.eweracs.my_script.prefs"] = {"Test1": [1: 2], "Test2": [2: 1]}

So not all is lost, it’s just far more error-prone to have to read my preferences with indexes instead of keywords. Oh well.

Edit: Okay, still not entirely sure what’s going on, but it seems the problem was that I inserted a None in one of my dictionaries, replacing that with a boolean worked. Odd.

None is not a ‘property list object’.