"onchange" only executing on script startup? (Aseprite v1.3-beta14-x64)

I’m very sorry for posting multiple times in quick succession, but I’ve been banging my head against this issue for a while and I don’t think the program is supposed to behave this way, but I don’t have enough evidence that this is not actually my fault, since this would for sure have been pointed out already!

I’ve been wanting to call a bunch of different functions based on what option has been set in the combobox. To test, I’ve only made them output to the console. But they never did.
So I’ve gone to the combobox and switched my function call to instead print to the console, in case I did something wrong there.
This only gets executed on startup and if I switch the option in the combobox, it does nothing.

Here’s the code snippet:

	id = "amountOfColors",
	option = "15",
	options =
	onchange =
		print("Changed Amount of Colors to 15")

Thank you so much for the help!

you have to put it inside function

onchange = function()
		print("Changed Amount of Colors to 15")

Thank you so much for your help!

I swear, I’ve tried that before and it threw me an error, which is why I left it out of a function. But now it actually works?!

1 Like