Dear all,
I think this does not work, because with closing the window, the variable and the scope has gone. JMP returns it in a different way. A global variable may work.
So when I struggle with these kind of things, I tend to look in the scripting index for the current way to do this kind of things (they may change somehow from version to version). And I find it as an example for "new window, modal", that I slightly modified, see screenshot and attached script. The reference of the window returns all you need.
Names Default To Here( 1 );
ex = New Window( "Dialog() example",
<<Modal,
<<Return Result,
V List Box(
H List Box( "Set this value", variable = Number Edit Box( 42 ) ),
H List Box( Button Box( "OK" ), Button Box( "Cancel" ) )
)
);
Show( ex );
Show( ex["variable"] );
neb_content = ex["variable"];
Show( neb_content / 2 );
Georg