2 Replies Latest reply on Jun 26, 2013 8:01 PM by philmodjunk

    Run script when closing popups



      Run script when closing popups


           When I began designing my solution, I disabled the close window button (the "X").  I did this because I created an "ok" button on my popups that run various scripts when a user clicks on it.  These scripts validate fields, etc before closing the window and running a script that maximizes the main window on win platforms.  I want these same scripts to run when a user clicks the "X" button.  I use FMP12 advanced and I know there is a way to customize what these buttons do, however I'm not sure if it is a universal setting or if the "x" button can be programmed uniquely for each popup window.  Can anyone clarify?


        • 1. Re: Run script when closing popups

               Each layout can have a script trigger, so you could use a script trigger such as onLayoutExit to perform your script.  File, Manage , Layout, then click the script trigger tab, the select the desired script trigger for your layout.

          • 2. Re: Run script when closing popups

                 Use Custom menus for the layout used with the pop up window and modify the close window menu option to perform a script--which you then design to do all the things you want to take place when the user clicks the X. This also enables the the keyboard shortcut for closing the window to perform the same script.