2 Replies Latest reply on Apr 24, 2017 7:36 AM by ndveitch

    Resume a paused script


      Hi there,


      I need to find out how I can resume a script with a script? I have built an email module for my client and when generating the email I have a number of scripts that the call the build email script and then they pause so that the user can modify the email before sending.


      On the SendEmail layout I have Send | Save | Cancel | Close buttons, and each button's associated script will return either a send, save, cancel, close as an Exit Script [ Text Result: "Sent" ] for example.


      All was working but I have noticed that although the script finishes and the calling script get the correct result, the calling script is stuck on the Pause/Resume script. I tried disabling the Pause/Resume but then the whole script ran through and sent the mail without letting me modify the email before sending. I know the script worked as I got the correct error message that the window had closed without sending the email.


      How would I send a command to the calling script to continue the script when I dont have the option for a button to be pressed to Resume the script?

        • 1. Re: Resume a paused script

          There is a script step that resumes a paused script it's the same step: pause/Resume Script.


          But it's often simpler to break the script in two parts. Instead of pausing, the script just exits. Then a second script performed from a "send" button performs the code originally placed after the pause as a second, separate script.

          2 of 2 people found this helpful
          • 2. Re: Resume a paused script

            I have been a bit of an idiot, as soon as I hit send on my post, it occurred to me that I do have buttons to press, and those are the buttons for the send, save, cancel and close on the email form.


            I have just tried changing the button options to "Resume Current Script" and it worked. I think this is the first time in my FileMaker career I have used the Button Options to resume a script, normally I use the single resume step.