4 Replies Latest reply on May 15, 2013 7:04 AM by philmodjunk

    Copying data from an external file

    eibcga

      Title

      Copying data from an external file

      Post

           Is FileMaker Pro capable of accessing a text file, copying the content of the text file, and pasting the content as a value in a field in a database?  If so, how?

           For example, a separate app generates an account number and exports it into a text file on a computer's desktop (this file content will change in the future, but the filename and file location will always be the same).  Filemaker then accessess the text file, opens the file, copies the account number from the file, and pastes the account number into a designated field as its value.

           For security reasons, the user does not enter the account number in Filemaker direclty into the field.  Rather, it's copied from an external source as described above.

           Thank you in advance.

        • 1. Re: Copying data from an external file
          ElishreeDey
               Hi,
                
               Though I have no exarct code for your above problem but I can give an idea. You can create a script in Filemaker if you are in Mac(SystemPlatform = 1) then can run a Perform Apple Script else if SystemPlatform other than 1 then you can run the Send Event command script step.
                
               You need to find for a do shell script for Perform Apple Script step which will open your sample.txt file from desktop and copy all content to clipboard. Then the contents are copied now and you can paste the value any where in your FM application.
                
               You need to find command prompt  syntax for Send Event Script step which will open your sample.txt file from desktop and copy all content to clipboard. Then the contents are copied now and you can paste the value any where in your FM application.
                
               Thanks Elishree
               FileMaker 11 Certified Developer
               Senior Software Engineer
               MindfireSolutions
          • 2. Re: Copying data from an external file
            eibcga

                 Thank you very much indeed. I suppose that another option could not be to import from file and use recurring import?

            • 3. Re: Copying data from an external file
              ElishreeDey

                   Hi,

                   Yes you can do Import Script step that's the easy one it can import from your text file to your Filemaker table's field. You need to specify the mapping in Import script step.

                   Thanks Elishree
                   FileMaker 11 Certified Developer
                   Senior Software Engineer
                   MindfireSolutions
              • 4. Re: Copying data from an external file
                philmodjunk

                     Exporting the text file to the desktop does not seem very secure as it would be easy to open the text file and read the contents.