0 Replies Latest reply on Apr 2, 2013 6:59 AM by hokiemike64

    Using Applescript to start FM and open a DB

    hokiemike64

      Title

      Using Applescript to start FM and open a DB

      Post

           Here is a bit of a challenge in integration. We are using a headless mac mini to drive many automation functions for custom production management DB. Occassionally, FM shuts down, the server will crash (rarely) or some remote mount will break connection. While all of these external factors are factors in why we would choose to restart FM on the Mini, they are coincident to what happens, WHEN we attempt to restart or recover normal operations.

           I have pulled my hair out on this and am probably missing a simpler solution so.. if anyone has set up something to "recover" or restart a database that is hosted on a Filemaker Server via applescript, I would certainly appreciate you lending me your support. Here is more...

            

           In the case of a power outage on the client, I have created a startup script in applescript to mount the server volumes and restart FM. What is interesting comes next as I cannot seem to join the two processes together without creating a timeout due to something odd.

           Here is the script ....

            

      tellapplication "FileMaker Pro Advanced"

      activate

      getURL "FMP7://UserName:Password@Address/NameofDB"

      tellmetodelay 10

      do script "[PROCESS] Start Timer Script"

      endtell

            

           Running this script in .app form causes the filemaker icon to bounce in the dock until the applescript app times out. If you click the item in the dock, the app continues to completion..

           If, however, your run the script that made the app file from the script editor (applescript editor), then.. it works flawlessly.

           The UI Scripting stuff in Mountain Lion seems to be failing as well, as I tried to call the dock process to get the FM Pro object selected using UI Elements scripting... even though documentation says you can do it, you obviously cannot as Applescript doesn't recognize the "Dock" process of the "Finder" application.