I would like to get the call stack as you see when you debug a script.
Moreover, it could be nice to get the object name of the button that was pressed.
Does anyone know if it is possible and how to do it?
I'm not aware of any direct way to do this. However, you could set up a variable (say, $$stack) and add the calling object name (whether script or button) to the top as it makes the call with a calculation like this:
Set Variable [ $$stack ; objectName & "<cr>" & $$stack]
where <cr> is the pilcrow (carriage return) character.
That way, $$stack will contain a return-delimited list that mimics the call stack.
Retrieving data ...