1 Reply Latest reply on Jul 28, 2011 9:41 AM by philmodjunk

    passing a filepath/file to the import dialogue box via scripting.

    ijontichy

      Title

      passing a filepath/file to the import dialogue box via scripting.

      Post

      First,

      A Big thanks to PhilModJunk.   I'm a sometimes user of this forum but I'm always impressed with the care he takes to answer ongoing concerns.

      Second my problem:

      Daily, I have data that I need to import into a filemaker database and it comes to me as a series of text files.

      text_01

      text_02

      text_03

      etc.

      I've scripted a way to store the filepath/filename necessary for import and I'm confident I can loop it until the list is exhausted, but I don't see any way to "paste" it into the import dialogues.   Ideally, I'd be able to add all of the text files to this dialogue box at once, but I cannot.

      Filemaker 11 Mac.    Thanks!

        • 1. Re: passing a filepath/file to the import dialogue box via scripting.
          philmodjunk

          If you put the filepath into a variable, you can refer to the variable as the source file for the import. The trick is to keep two file references like this in your Import Records script step:

          $PathVariable
          SampleFileName

          Where "SampleFileName" is a direct reference to a specific file by name.

          The second reference makes it possible to specify the field mapping and other import details when you set up your script, but the script will assign a value to $Pathvariable so it will identify the actual file used as the source during import when you run the script. (I really tore my hair out one evening until I chanced upon this trick by accident.)