Hi.
I’m trying to change smart component values via scripting. It works well but only after when I close and reopen the file or change the value manually(which means via UI, not scripting).
This is the code I’m using. :
for l in Font.selectedLayers:
for c in l.components:
if "_smart.component" in c.componentName:
c.x += 10
c.y += -10
c.smartComponentValues["Width"] += 10
print("done!")
And this is the error message I get when I run the script without reopening the file. :
Traceback (most recent call last):
File "<macro panel>", line 6
TypeError: can only concatenate str (not "int") to str
It is not fatal but quite annoying.
Any suggestion?
What version of Glyphs do you have? I can reproduce the problem in the stable version, but the latest cutting edge version has this fixed. Please give it a try. Activate it in Preferences > Update > Show cutting edge versions.