4 Replies Latest reply on Aug 19, 2015 1:44 PM by user25682

    FM Go: Dynamically Generate Output Text File Name

    user25682

      Hi there,

       

      I'm developing a Filemaker based replacement for an outdated inventory scanner system. The current system uses Windows CE scanners to scan a barcode to set the ShowName (different name for each show, can have multiple shows per inventory session), scan the product code, have the user enter the quantity, lather, rinse, repeat. Eventually, the scanner ends up on the desk of our inventory person who downloads the text files to run through a custom piece of software and imports the inventory transactions into NetSuite.

       

      The scanners and software are no longer supported by anyone involved with creating the system.

       

      The text files need to be named ShowName.txt. I've duplicated most of the functionality (and vastly improved some things, as often happens in FMP) so far in FMPro and have the Script exporting the text file in the proper format and with the proper name...on the Mac (using a $filePath example I found). However, this fails on FileMaker Go. That's not surprising, but I can't find any examples of doing this.

       

      For the people who will be using iOS devices, I really need it to be "push button simple". Double check your scans, lock the records, then export the text file(s) and email them. These devices will be used inside of steel structures where there is an obliteration of external radio signals.

       

      Script Steps are as follows:

       

      Set Variable $filePath

      Value: Choose ( Abs ( Get ( SystemPlatform ) ) -1 ; Get ( DesktopPath ) & PyroScanner::Show Name & ".txt" ; "filewin:"& Get ( DesktopPath ) & PyroScanner::Show Name & ".txt" )


      Export Records $filePath

       

      I just saw that "Show Name" has a space in it. Hmmmm.

       

      Any ideas?

       

      Thanks!

      Jason

        • 1. Re: FM Go: Dynamically Generate Output Text File Name
          Stephen Huston

          Go requires some special handling because of the non-accessible file structure of iOS.

          You need to set your $filepath variable via a calc, using If/If Else, so that IF you are running GO it sets the location to the Temp folder (a Get function) and then uses that location to email the file to an appropriate recipient so that it's not lost/abandoned at the end of the session.

           

          Alternatively, if using GO, you could just branch to an email step and collect the appropriate info from the record fields to use in the body of the email. This could be sent to a special email address just for collecting this info, and then have the appropriate recipient(s) process info from the emails at that address.

           

          I'm sure there a a few other work-arounds for GO, but it does have to be handled differently than a standard computer with open file structure.

          • 2. Re: FM Go: Dynamically Generate Output Text File Name
            Julio Toledo

            On iOS, applications are Sandboxed, and each their own home directory.

             

            On GO, you can export to the "Documents" folder, which means the same directory where all the locally stored .fmp12 files are located. This is the same way that container data can be exported out of GO and into the iOS file system.

             

            Alternatively, you can export to the "Temp' folder, but that is not user accessible. It would be more useful for another script step in your solution to work with external files without littering your GO's Documents folder.

             

            Once the text files are listed in GO's document list, you can handle them anyway you like, including plugging the iOS device into a computer and downloading the files via iTunes.

             

            Another way, as Stephen Huston mentioned, is to have them sent out by email.

            • 3. Re: FM Go: Dynamically Generate Output Text File Name
              user25682

              Thank you so much, Stephen!

               

              I just added an "If / Then" to test if SystemPlatform = 3 after the previous Set Variable, copied the previous Value and changed Get (DesktopPat) to Get (TemporaryPath), and voila!

               

              Oh yeah, and configured the Mail client on this previous broken iPhone5. That helps significantly with actually sending the email.

               

              Woo hoo! Thanks again!

              • 4. Re: FM Go: Dynamically Generate Output Text File Name
                user25682

                Thanks, Julio.

                 

                I will look into having it save in the Documents folder instead of the Temp. This is the first time I've messed with getting data out of Go.