6 Replies Latest reply on Mar 23, 2015 3:42 PM by jgalt

    Is it possible to quit and relaunch FileMaker from a FileMaker script (Mac)?

    jgalt

      I have a FileMaker script that installs a custom font. Unfortunately (on Macs) the new font does not load until FileMaker is restarted. Is it possible run to do this with a terminal command or  AppleScript?

       

      I tried this AppleScript which quits FileMaker but does not reopen it:

       

      tell application "FileMaker Pro Advanced"

          quit

      end tell

       

      delay 5 -- Wait for FileMaker to close

       

      tell application "FileMaker Pro Advanced" to activate

        • 1. Re: Is it possible to quit and relaunch FileMaker from a FileMaker script (Mac)?
          user19752

          Somthing like

          Tell Application "Finder"

              Open file "Server HD:Applications:FileMaker Pro 13:FileMaker Pro"

          End Tell

           

          Don't you want to open data file instead of application?

          • 2. Re: Is it possible to quit and relaunch FileMaker from a FileMaker script (Mac)?
            nicolai

            +1 to user19752 - you will probably want to open file.

             

            On the other hand, I do not see anything wrong with your original script. Works fine for me. Check how long does  it take to close the file, may be need to increase delay.

             

            tell application "FileMaker Pro Advanced" to activate
            • 3. Re: Is it possible to quit and relaunch FileMaker from a FileMaker script (Mac)?
              sporobolus

              On 2015-03-22 23:53 , jgalt wrote

              I have a FileMaker script that installs a custom font. Unfortunately (on Macs) the new font does not load until FileMaker is restarted. Is it possible run to do this with a terminal command or  AppleScript?

               

              I tried this AppleScript which quits FileMaker but does not reopen it:

               

              i am guessing your script was run from within FileMaker, so FileMaker

              cancels the script when it quits

               

              i would use Send Event to launch an external script; i would also not rely

              on "delay" because apps can take a long time to quit or just fail to quit —

              use a simple loop to test whether the app has finished quitting before

              relaunching

               

              here is the script i would use; tested and works for me

               

              -- save this script as application and run from a FileMaker script via Send Event

              -- turn of Wait for event completion

              -- next step after Open Event should be Exit Application

               

              repeat 100 times -- failsafe in case FMP gets stuck while quitting

                tell application "FileMaker Pro Advanced"

                  if it is not running then

                    activate

                    exit repeat

                  end if

                  delay 1

                end tell

              end repeat


              (edited to fix the script since <code> no longer works right from email)

              • 4. Re: Is it possible to quit and relaunch FileMaker from a FileMaker script (Mac)?
                siplus

                If you work on many machines, I'd rather use Apple Remote desktop.

                 

                With it you can schedule and or execute things like killing filemaker on all clients, copying a font at the right place and launching filemaker on all clients.

                • 5. Re: Is it possible to quit and relaunch FileMaker from a FileMaker script (Mac)?
                  jgalt

                  steve harley wrote:

                   

                  here is the script i would use; tested and works for me

                   

                  -- save this script as application and run from a FileMaker script via Send Event

                  -- turn of Wait for event completion

                  -- next step after Open Event should be Exit Application

                   

                  repeat 100 times -- failsafe in case FMP gets stuck while quitting

                    tell application "FileMaker Pro Advanced"

                      if it is not running then

                        activate

                        exit repeat

                      end if

                      delay 1

                    end tell

                  end repeat


                  (edited to fix the script since <code> no longer works right from email)

                   

                  Thanks very much for the example Steve.

                  • 6. Re: Is it possible to quit and relaunch FileMaker from a FileMaker script (Mac)?
                    jgalt

                    siplus wrote:

                     

                    If you work on many machines, I'd rather use Apple Remote desktop.

                     

                    With it you can schedule and or execute things like killing filemaker on all clients, copying a font at the right place and launching filemaker on all clients.

                    Thanks siplus, I have never used Apple Remote Desktop. I will look into it.