Orgainzed event actions on button in perspective

we have a machine that needs remote settings configuration. I am asked to duplicate the HMI on the machine. I only have access to the settings tags, a save tag, and a exit without saving tag.

On a button, under event, I first set up a script action that sets the save tag to true. Then on the next action, I configured the popup action to close the settings popup.

It seems like the close popup action is interfering with the first action (the tag write script).

I thought the actions would operate in numerical order since they are listed by number and we are given the abilty move the configured actions up or down in the list.

Can anyone help me by explaining how multiple actions are compiled and run?

Thanks so much,

This has come up several times. The various scripts run asynchronously, so there's no guarantee they will finish in a specified order.

thanks. That is what I assume but I wanted to know for sure.