5 Replies Latest reply on Feb 5, 2010 3:32 PM by philmodjunk

    Running Scripts on Filemaker Server Advanced  According to Time of Day

    Sez

      Title

      Running Scripts on Filemaker Server Advanced  According to Time of Day

      Your post

      Hello Team,

       

      I hope there is a simple solution to this problem but I am certainly not seeing it. 

       

      I have a Filemaker database that runs a script to pull data from an Oracle data base, configure a report, then email it to a select group of recipients.  Right now, these actions are triggered at system start up.  When the computer starts up an automator script runs to launch mail, then FMP 9, which in turn runs a scripts that performs these functions.  Works great.

       

      However, now that I have Filemaker server advanced, I'd rather just leave the database running on the server machince as a shared database, and perform those tasks every morning at a certain time.  It seems like this should be possible, but I'm not seeing the solution.  Any ideas on how this can happen would be very welcome.

       

      - Sez

       

       

        • 1. Re: Running Scripts on Filemaker Server Advanced  According to Time of Day
          TSGal

          Sez:

           

          Thank you for your post.

           

          FileMaker Server 10 has the ability to run scripts at a specified time.  However, some script steps may not be compatible with FileMaker Server.  For example, sending mail through the Email client is not possible with server, but it is through SMTP Server (and that is not available with FileMaker Pro 9).

           

          Please specify the script steps you are currently using with FileMaker Pro 9, as this will provide more detail.

           

          TSGal

          FileMaker, Inc.

          • 2. Re: Running Scripts on Filemaker Server Advanced  According to Time of Day
            Sez
              

            TSGal,

             

            Thanks for the reply.  They are pretty basic scripts.  I use the following;

             

            Go to Layout

            Show all records

            Delete all records

            Perform Script [GetPSData]

            PerformScript [PrintBishop]

            This one is repeated 7 times for different locations so there are 7 more PerformScripts

            Goto layout

            Enter browse mode

            close file 

             

             

            The "GetPSData" script grabs and imports data from an external Oracle database.  All of the "Print" scripts go to a report layout, save the layout as a PDF, and each one sends a copy to a different location.  This happens once a day.

             

            I hope this makes sense.

             

            - Sez 

            • 3. Re: Running Scripts on Filemaker Server Advanced  According to Time of Day
              TSGal

              Sez:

               

              Have you set up a Schedule in FileMaker Server 10 Advanced?  From the Admin Console, click on "Schedules" in the left pane.  On the right side, next to "Actions: ", select "Create a Schedule..." and click "Perform Action".  In the "Select a Task" screen, select the option to "Run Script" and click Next.  In the next screen, I'm not sure how you are sending the emails.  That is, if you are doing all of this within FileMaker, then only select "FileMaker Script".  If some of this is being done externally, then select "Script Sequence".  For now, assuming this is all done within FileMaker, select "FileMaker Script" and click "Next".  Select the database file, enter the Account Name and Password information and click "Next".  Select the script you want to run and click "Next".  On this screen, set the time you want this script to run, and all other parameters (daily, Start Date, etc.).  Continue on with the remaining steps as they are self-explanatory.

               

              If you need clarification for any of the above steps, please let me know.

               

              TSGal

              FileMaker, Inc. 

              • 4. Re: Running Scripts on Filemaker Server Advanced  According to Time of Day
                Sez
                  

                TSGal,

                 

                Well, I think I'm getting closer.  I set the schedule to run the "startup script" which in turn runs all of the print and save scripts.  However nothing seemed to happen.  Generally I get a folder full of PDF's and end users get the appropriate PDF sent to them.  But none of those steps happened.  When using Filemaker 9 the database connects to an external database using the "Actual" Oracle driver.  As mentioned above, the startup script contains sub scripts that save and send a PDF to a specific end user.  The "PrintBishop" command is;

                 

                Enter Browse Mode

                Go to Layout ["RawData" (Data)]

                Perform Find [Restore]

                Sort Records [Restore;No Dialog]

                Go to Layout ["Stu 13 "Data"]

                Enter Preview Mode[]

                Save Records as PDF[Restore; No dialog; "bishop.pdf";Records Being Browsed]

                Send Mail [No dialog; To: "emailaddress@sesd.org"; Subject: "Todays STU 13 - NO Reply";Message; "Lots of text here....."

                 

                There are seven more of these "subscripts" within the startup script that target differnt sorts and save/sends of the data.

                 

                Do I need to rewrite all of my scripts?  Do I need to setup a different ODBC connection for FMP Server Advanced?  Is there any documentation that can help me transform my databases so that they are functional with FMP Server Advanced?

                 

                Let me know what you think.

                 

                - Sez

                • 5. Re: Running Scripts on Filemaker Server Advanced  According to Time of Day
                  philmodjunk
                    

                  Since a server scheduled script can't import records from another filemaker file, I doubt that it will successfully import from an external data source such as Oracle.

                   

                  You may have to set up a filemaker robot file that logs into your server hosted file as a client, runs the script and then quits. You can use an operating system level utility like windows task scheduler to open the robot file at a specified time.