4 Replies Latest reply on Sep 28, 2010 12:53 PM by TorSolli-Nowlan

    Scheduling system-level scripts and email



      Scheduling system-level scripts and email

      Your post


      I'm currently running an export script manually from a FMA 10 client, and then running an external script on that data to do parsing and email reports to specific people as needed. I'd like to turn this into a single, scheduled script with Script Sequence in FMSA 10 on MS Windows Server 2008.

      I have VBscript that sends a plain test email on the server. When run directly on the server, it sends the email correctly. When run as scheduled system-level script, I get an email saying the script ran successfully but there is no email from the script.

      Is there a document somewhere detailing how FMSA runs external scripts, what permission level they run at, etc? Does anyone have suggestions as to how to do this without scheduling the export in filemaker and the parsing / email in the OS?


        • 1. Re: Scheduling system-level scripts and email

          You might search the Knowledge Base. Server Side scripts do have significant limitations. Out of curiosity, why not use Send Mail with the SMTP option? That version of Send Mail is server script compatible.

          One gotcha is that data references are severely limited. If Your VBScript refers to a location on a different machine, it won't work even though you can run the file independently of server without any trouble.

          Scripted Imports and Exports in a server scheduled script are extremely limited. You may find it much easier to setup the whole script to run from FileMaker Pro "robot" file that logs in automtically and runs from a client session instead of a server scheduled script. Robot files are Filemaker Files set to run from Windows TaskManager. These files have a script that runs automatically when the file is opened so TaskManager opens the file and then the "on open" FileMaker script takes it from there--usually with a script that ends in either Close File or Exit Application to close the file when done.

          For more on Import/Export in a Server Script, see:  http://help.filemaker.com/app/answers/detail/a_id/7035/kw/Import%20server%20scripts

          • 2. Re: Scheduling system-level scripts and email

            I checked through the Knowledge Base, but was having trouble finding details on specifics beyond, "You can schedule external scripts". The emails are the goal of the script, but it is not being done outside FM just for the process of sending them. There is a fair bit of data crunching that, while probably doable within FM, would be a lot more work than doing it externally.

            The VBscript itself simply calls a powershell script (as FM does not support running powershell directly and our admin vetoed a perl install), that sends a brief test email. The powershell script has been tested to work when run directly or via the VBscript while on the server, in the FM Scripts folder. I've done some brief testing on the data exporting, but that does not look like it will be much of an issue currently. We have had problems automating the sending of emails from FM, so that was the first issue I wanted to test.

            As the main limiting factor is coupling the data export process to the external script doing the processing of the exported data, I had not really looked at setting up a "robot file", though I suppose I could link the processes in a batch file. I was hoping FM's combined internal/external scripting would be able to function as desired.

            • 3. Re: Scheduling system-level scripts and email

              If you are just using Server to control when the VBScript executes, you might instead schedule this with Windows Task Scheduler.

              • 4. Re: Scheduling system-level scripts and email

                It's not so much the running of the VBscript or the export of the data, but the coupling of them together. The find / export process can take a varying amount of time depending on system load and number of matching records, so I was hoping to avoid staggering schedules on when the process "should" be finished. Using the "Script sequence" option on FMSA's scheduling options seemed to be the ideal choice, assuming it worked as advertised: that external scripts could be successfully run before and after an internal script.

                It is very frustrating to find an increasing number of options on Filemaker that, apparently, do not actually function beyond an extremely limited form. It makes me wonder the purpose of offering them at all, if the solution is to just use a workaround or not use the functionality at all.