3 Replies Latest reply on Aug 28, 2010 8:55 PM by Atrot

    Sending an event using a file within the database

    Atrot

      Title

      Sending an event using a file within the database

      Post

      I'm Using Filemaker 10.0v3 on XP and would like to know if it is possible to use a script to trigger the opening of a batch file that is stored in the database.

      e.g.

      I have a Table of Customers and some of the fields in this table contain .bat files that consist of simply a ping command pinging some of the devices of that customer and exporting the result.

      I would like to make a script that triggers these batch files but only triggers the files that are in the current selected record of this customer.

      Am I asking too much of this already great  program?

        • 1. Re: Sending an event using a file within the database
          MikhailEdoshin

          To run a batch file you have to save it on disk first using the Export Field Contents script step. It works best if the file is a real file, not text; if it's stored as text, the resulting encoding will be UTF-16 and I'm not sure this will work for batch files.

          Once the file is saved on disk, you can run it with Send Event script step. The open Event will do, I guess, but it's also possible to execute an arbitrary system command this way.

          The hardest part is to get back the results; the only way I can think of would be to write them into a file and then import the file back to FileMaker. To do this within a single script, you might have to add a pause between Send Event and Import script steps.

          • 2. Re: Sending an event using a file within the database
            Atrot

              Thanks Mikhail, thats exactly how I have done it so far although what I was actually asking is if it was possible to open/send an event from a file within a container field.

             When you "send an event", the program prompts you to select file, calculation or text. When choosing "file" it asks where on you PC/Network this file exist. I wish to run the file from within a field within a specific record so I can use the same script for every customer, as each customer will have a different batch file.

             Do you know if this is possible?

            • 3. Re: Sending an event using a file within the database
              Atrot

              I have figured it out.

              You can do this by using the "calculation" option.