How to receive output of a popup in a script?

Hi,
I have a functionality where scriptA opens a popup which has ScriptB with B1 and B2 functions for the two buttons in the popup I want to get the value which button was clicked in scriptA.

Hi, maybe you could try using api event.getButton.

thanks so much this was so useful