Macros deleted without prompting for saving

I just lost several hours’ work because I accidentally clicked the ‘x’ close button on a macro, which is deleted without saving.

The macro window is meant for scripts of a few lines. For bigger projects, work in a dedicated python file in the Scripts folder.

Maybe you can restore it with TimeMachine. The scripts are stored in ~/Library/Preferences/com.GeorgSeifert.Glyphs3.plist

Perhaps you can restore yesterday’s version of that file?