5 Replies Latest reply on Jul 10, 2016 10:03 AM by AA

    File path variable

    AA

      Hi,

       

      I am looking for solution to export records into a .csv file. however I am facing an issue. When I tried to specify file path with a field record I get error message. When I simply specify the path with text ("c:\chat") it works fine.\

      I would like to use a field record to allow users to set custom file path when they exporting the file into .csv .

      Please see images below

       

      It is doesn't work.

      fm path 1.png

      It works fine:

      fm path 2.png

        • 1. Re: File path variable
          beverly

          if you manually select a file for export, note the dialog and the 'paths' needed.

          typically a

          "file: ____

          is needed.

          beverly

          • 2. Re: File path variable
            BruceRobertson

            Of COURSE script 1 doesn't work.

            Line 3 should be

            Export Records[ $filename; Windows(ANSI)]

             

            Also - Line 1 appears to have absolutely no purpose.

            • 3. Re: File path variable
              taylorsharpe

              Beverly's advice is good and thorough.  If you're just wanting to say export this to say your desktop or documents, this works in both Windows and Mac OS X environments. 

               

              $Path = Get ( DesktopPath ) & "file.csv"

              or

              $Path = Get ( DocumentsPath ) & "file.csv"

               

              If you do it manually.  You have not take into account operating system behavior such as forward or backwards slashes, etc.  See Beverly's link for all of that. 

              • 4. Re: File path variable
                richardsrussell

                I try to allow for the possibility that the user might be using either a Mac or a Windows machine. The note embedded in the sample script below is my reminder to myself of how it works. The script originally had a final custom dialog saying "Export Complete. You may open your exported file now.", but that became superfluous once I checked the "Open file upon completion" option in the Export dialog. I think the beeps are still helpful, tho (except they don't work under Windows).

                 

                BTW, if the abbreviation "GTY" seems odd, it's because my client's corporate name is gThankYou, an issuer of gift certificates for holidays like Thanksgiving and Christmas.

                 

                Export Eddresses.jpeg

                • 5. Re: File path variable
                  AA

                  Thanks for the replies to all. I am looking for a solution that allows user to specify the Export Path, and not just only two options would be possible as Desktop or Document.