There are some doubts about these methods

glyph.beginUndo()
glyph.endUndo()
layer.beginChanges()
layer.endChanges()
When these methods are appropriate, API says they are used when there are bigger changes, how to distinguish the boundaries of bigger changes, such as I perform adding background to each layer of all selected glyphs, or decompose all layers components of all selected glyphs, Need not use its?
If I only perform simple operations, can I also use them? Will it affect the efficiency of execution?

It is what the user will regard as one step. It summarizes all the tiny things that are undone with a single Cmd-Z.

The undo methods are not that important any more. That was more needed on some point.

The Changes methods can speed up the script quite a bit. When you do several things to a layer, put that between the layer.beginChanges() and layer.beginChanges() calls.

1 Like

I’ll update the snippets.