Can my script save the state of variables between invokations?

yes. there are two ways.
script as an extension plugin can save presets as plugin.preferences.
sadly, i don’t know anything plugins. @thkwznk could probably tell you more as his sprite analyzer does save presets.
the other possibility is to use lua functionality. aseprite supports lua almost completely, which means you can read and save files. the simplest way would be to store parameters as separate lines in a text file (so you’d have just a single preset) like i have in sessions script and then load the default values from the table.
or you can google and use parser for json or ini files. here’s one for ini: inifile.lua.
to save the settings automatically you’d have to add save function to dialog’s onclose event.

2 Likes