1 Reply Latest reply on Feb 16, 2009 12:16 PM by Orlando

    Check to see if file is already open

    djweisman

      Title

      Check to see if file is already open

      Post

      I have a menu file that opens several different filemaker databases. I use the open file command to switch to the appropriate Filemaker file. If it is already open, it just switches to the appropriate file.

      Is there any way to determine if the file is already open in my script so that I can take different actions depending on the state?

        • 1. Re: Check to see if file is already open
          Orlando
            

          Hi djweisman, and welcome to the forum

           

          You can check if a file is open already using the 'DatabaseNames' function in a an If script step in your open button script, so your script may look something like this if you were checking for a file called "Contacts":

           

          #
          If [ Length ( FilterValues ( DatabaseNames ; "Contacts" ) ) ]
          # File is already open
          Select Window [ "Contacts" ]
          Else
          # File not yet open 
          Open File [ "Contacts" ] 
          End If
          #

           

          I hope this helps