4 Replies Latest reply on Mar 23, 2015 7:49 AM by Musoguy

    Script Trigger question when "opening" Filemaker Go 13

    Musoguy

      Title

      Script Trigger question when "opening" Filemaker Go 13

      Post

      Hi folks. Not sure how to test this (without having to wait 24 hours) so wondering if anyone can shed some light for me! I'm creating my first IOS companion solution to a desktop solution I've already created for a company (Filemaker Pro 13 and Filemaker Go 13). I'm writing a script that checks the start date of the database (when the user first enters info) against today's date. If the date has changed, resulting script steps will run. If I was doing this on a desktop solution, I'd just attach a script trigger when the database opens.

      With IOS when you hit the home button on your phone, it just puts the Filemaker Go app into the background. So I presume when I go back into it, the script trigger will NOT fire with an OnFirstWindowOpen script set in the File Options. Is this correct? If so, I figured I could in theory set the trigger to OnGestureTap. The problem is I don't really want the script to fire every time the screen is tapped and slow down the solution (even though the If command will return as false 99.9% of the time)

      Is there a better way to do this? I basically want the script to only fire when Filemaker is brought into focus.

      Thanks in advance for any advice,  James

       

        • 1. Re: Script Trigger question when "opening" Filemaker Go 13
          SteveMartino

          What is it you are trying to do or trying to prevent with this trigger? 

          To test the trigger, you could show a custom dialog with the simple message "OnFirstWindowOpen trigger fired" in the first line of the script, then you'll know if it is firing every time.

          • 2. Re: Script Trigger question when "opening" Filemaker Go 13
            Musoguy

            Hadn't thought of that. Good point! Will do that to test it, thanks.

            The Go solution will be used for two days at a time (and then emptied) to enter photos of people that will then be imported to the main database. The script that I am triggering is basically looking to see (when the database is opened) if the day is currently the same day photos were first entered or the following day, and highlight a visual representation of this with conditional formatting (i.e. highlighting a box that says Day 1 or Day 2). So there is no need to trigger the script every time a photo is entered as the working day will always end way before midnight. The script itself was the easy part, it's figuring out how to trigger it that I was trying to work out how to do (or test). Not sure why I didn't think of a custom dialog, I often do that in regular solutions where the Script Debugger can't help! Thanks again :)

             

            • 3. Re: Script Trigger question when "opening" Filemaker Go 13
              philmodjunk

              You might use a combination of OnFirstWIndowOpen and InstallOnTimerScript--with a really large interval to set such a "48 hour" time limit.

              • 4. Re: Script Trigger question when "opening" Filemaker Go 13
                Musoguy

                Thanks for the reply Phil. Yeah, I discovered the OnFirstWindowOpen trigger by itself doesn't work. I like your idea.

                Off the top of my head, I should be able to write a calculation in the InstallOnTimerScript to set the time delay using the get(CurrentTime) function to figure out how long it is until midnight. The resulting script will run if the database is still being used at midnight. If it is not, I can add a field that is set to the date the OnFirstWindowOpen trigger was last run and check if the date matches. Thanks for sending me in the right direction :)