I do this by taking advantage of the ability to Resume the current
script when a button (set to run another script) is pressed.
The Select and Cancel buttons are both set to Resume the current
script. And they are one-line scripts that do something like:
Set Variable $modal_result = 1
And
Set Variable $$modal_result = 2
The basic main script is then:
New Window
Go To Layout
Allow User Abort[Off] // to make the layout modal
Pause/Resume Script[Indefinitely]
If $$modal_result = 1
Do some stuff
Else If $$modal_result = 2
Do some other stuff
End If
Probably could be more elegant, but the basic concept works for me.
Steve
On 16 Feb 2009, at 20:53, Bruce Button wrote:
I want to create a modal pop-up layout with two buttons, say
"Select" and "Cancel". When the user presses "Select" one action
must happen, and when the user presses "Cancel" another action must
happen.
I have set up the layout as follows:
New Window
Go To Layout
Allow User Abort[Off] // to make the layout modal
Pause/Resume Script[Indefinitely]
I can get the script to resume by assigning the Resume Script
script step to a button, but how do I distinguish between the
buttons? If I assign a separate script to each one, then the
original script (as above) remains active and paused. There seems
to be no way to restart that script from another one.
(I'm using FMPro Advanced 8.5 on Windows XP.)
Any ideas would be greatly appreciated.