3 Replies Latest reply on Jan 11, 2013 5:24 PM by philmodjunk

    Import File with date change

    bookalaka_1

      Title

      Import File with date change

      Post

           Hello,

           I have a script that imports an excel file from an email I receive daily however the date changes and I always have to find the file on my HD. How could I get this to find the file and ignore the date or find the most current date? This is what I download "DI Container report 1-11-13.xls"

           Thank you for reply,

           Bookalaka

        • 1. Re: Import File with date change
          philmodjunk

               You might be able to do this if you were able to get a list of the file names of all files in a given folder.

               FileMaker can do this if the folder of excel files is located inside the documents folder.

               FileMaker can  do this with any folder if you acquire one of the plugins that offer this added capability.

               FileMaker can do this with a system script--though such are specific to a particular platform. A batch file, for example can use the DIR command to generate a text file of the filenames and then FileMaker could import such a text file to get the list of filenames.

               Whichever method you use, once you have a list of filenames, a script can select the filename with the largest date and from their a file path to the file can be constructed, put in a  variable and used with the Import Records script step to import data from this specific excel file.

          • 2. Re: Import File with date change
            bookalaka_1

                 I  down load the file from an email with my default settings saving files to drop box after my FM script runs applescript deletes file to the trash.  If I were to name a folder "Documents" on drop box would that work? Not sure if this is worth a plug in expense for me. I am running on 11 does 12 do this?

                 What would the scripting be using the Document example? Use a susbstitute function?

            • 3. Re: Import File with date change
              philmodjunk

                   Documents is a standard folder located on both mac and windows computers.

                   Get ( DocumentsPath )

                   Returns the file path to this folder on your local computer.

                   Get ( DocumentsPathListing )

                   returns a list of all folders and files contained by Documents on your computer.

                   adding a new folder and naming it "documents" will not make it the Documents folder.