November 17, 201213 yr I am running FM 12 03 advanced in OSX.  I have a layout called Patients.  I have allowed the 'X' close button the window to let the user close the window.  When the user clicks the 'X' to close the window, I prompt the user with the querstion: "Are you sure you want to exit ?" (Y/N)  If they press No, I want to negate the 'X' close window button and leave the window open.    The problem is that at the end of the script, even if the user says 'No', after the script closes the window closes anyway.  I think I can capture their response in a $$Variable and then after the window closes if $$Variable ="No" then reopen the window. But, isn't there a way to negate the "X" choice and just leave the window open?  Â
November 18, 201213 yr Author Before 'End If' add the script steps: Else Exit Script [Result: 0] That worked. Am I correct in understanding that letting all the script steps complete WITHOUT a EXIT let's the 'X' close window complete. But, when I interrupt the script with the Exit, it aborts the 'X' Close? Thanks for replying...
November 18, 201213 yr You need to make the script result 0 (zero, false). Then the intended user event is canceled. This works only with triggers which are executed before the triggering event of course. When the result is based on a calculation make it 1 (one, true) to allow the event See the help for more information (click on a trigger to see if it is executed before or after the event) http://www.filemaker.com/12help/html/script_trigg.38.1.html#1029602
November 18, 201213 yr I believe this is better off handled using a custom menu, by modifying the Close command to issue the prompt. Also, don't exit the FMP application, just close the window. An assumption is being made that your window is the only one that the user has open. I find nothing more annoying than closing somebody's database only to find that it quits the whole application. The horror!
Create an account or sign in to comment