9 Replies Latest reply on Feb 3, 2016 4:57 AM by coherentkris

    Filemaker Server Script Question

    dgreensp_1

      I'm trying to setup a daily scheduled script on FM Server 14.  It is a script that I have in one of my hosted FM databases on that server.

       

      The script has one line:

      Import Records (No dialog; External Filename; Add; Mac Roman)

       

       

      The file where the script is importing from is on a second FM Server of mine hosted off-site.  Unfortunately, every time I try to run this script it fails.  When I try setting it up using a File hosted on the same FM Server it works.  Can FM Server not run a scheduled script where it imports from a different FM Server?

       

      Any help would be greatly appreciated.

        • 1. Re: Filemaker Server Script Question
          wimdecorte

          You can not import directly from one FM file to another one like this.  (FMS can not be a client of another FMS).

          So you'll have to make it a two-step process: export from one server to an intermediate file format (CSV, mer,...), import on the second server from that file.

          And obviously you'll have to find a way to move the file around.

           

          Or you can use a robot FMP machine instead of a server-side schedule.  FMP can be the client of two FMS boxes at the same time.

          • 2. Re: Filemaker Server Script Question
            dgreensp_1

            wimdecorte - thank you for the answer.  I can setup a script on the offsite server to export the file and I can setup a script on the internal server to import the file, but now I have to figure out how to automatically move the file from the offsite server to the internal server.

             

            Not sure I understand the robot FMP idea.

            • 3. Re: Filemaker Server Script Question
              robwoof

              A "robot" is a computer running FileMaker Pro and set up (via OnTimer scripting or some other method) to run a process or some processes on a schedule. Since a single copy of FileMaker Pro can be logged into databases on multiple FileMaker Servers, you could have a timed script that does the import from one file to the other in FileMaker Pro.

              Another option is that the "robot" could be FileMaker Pro running on one of the FileMaker Server machines. Your security policies may not allow this, but it cuts a separate machine out of the picture. As long as FileMaker Pro on one of the servers can also connect to databases on the other, you're good to go.

              HTH

              Rob

              • 4. Re: Filemaker Server Script Question
                ch0c0halic

                Wim and Rob are both right, as far as they go.

                 

                You didn't say which OS you are using.

                 

                On a Mac you can use an AppleScript folder action to transfer the file from the source computer to the destination computer.

                 

                You should never expose the FMS folders in file sharing so the destination should be a folder outside of the FMS folder structure.

                 

                Then use a second folder action to move the fie from the shared folder into the FMS Documents folder, be sure to also change permissions so FMS can read the file.

                 

                On a Windows you can use .BAT files running on a schedule to do the same things.

                Although I'm sure Wim has a better way to do this.

                 

                Use the most recent versions of FMP and FMS together.

                • 5. Re: Filemaker Server Script Question
                  user19752

                  If you can set up one of servers to ODBC sharing, it may be done directly.

                   

                  Wim is correct, but I think FMI should be able to implement direct import from other servers, since the scheduled or PSOS script is running on server machine but not as server, one of (emulated) clients. Maybe something like slowdown that not implementing server side printing / PDF saving

                  • 6. Re: Filemaker Server Script Question
                    dgreensp_1

                    These suggestions all look good.  I forgot about AppleScripts.  I can definitely try that.

                     

                    robwoof - if I did a robot machine, I didn't know that FileMaker Pro or Advanced can do timed scripts - what solution is there to run a script in FM Pro at a certain time?

                     

                    Thank you!

                    • 7. Re: Filemaker Server Script Question
                      wimdecorte

                      FM has an "install on-timer" script step:

                      Install OnTimer Script

                       

                      Or if you are more into OS-level event schedulers than you can write an AppleScript (or batch file or VBscript on Windows) to run the script and schedule it through the OS.

                      • 8. Re: Filemaker Server Script Question
                        dgreensp_1

                        Never used that before - this is great.  Thank you!

                        • 9. Re: Filemaker Server Script Question
                          coherentkris

                          I built a solution that uses an opener file on server B that allows a server side scheduled script on server A to move data from server A file to server B file.

                           

                          It overcomes the fact that FMS server sessions do not share credentials between servers the way that client sessions can easily work with files on other servers.

                           

                          K