Thanks to all of you for the helpful suggestions on creating a modal pop-up. You have helped me to solve the problem. It seems that the best way is to send the main script to another one, and to put only the Pause/Resume Script step in that one. Then the two buttons are each assigned the Exit Script step, but with different Script Results. On pressing a button one is returned to the main script from where one can use the Get(ScriptResult) function to perform the different actions.

I still haven't figured out how to resume one script from another one.

Best regards
Bruce Button

Steve Cassidy wrote:
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.

__________ Information from ESET NOD32 Antivirus, version of virus signature database 3859 (20090217) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




Reply via email to