2 Replies Latest reply on Aug 1, 2013 3:50 PM by user539

    Scripting file name for export to Excel

    user539

      Title

      Scripting file name for export to Excel

      Post

           I want to be able to use the content of a field in a found set to build a scripted file name for an export to Excel. I just don't seem to get how to do that. I inherited a script that sets a complex variable and does so using GetDesktopPath to name the file to be exported. However, my user wants to chose their own path for saving, but keep the scripted file name based upon a field in the found set.

           I'm certain I just am missing something that is staring me right in the face. I haven't been able to find an example to use to understand. I'm attaching a screenshot.

           Bill

            

             

      Screen_Shot_2013-08-01_at_1.03.42_PM.png

        • 1. Re: Scripting file name for export to Excel
          philmodjunk

               And how will the user choose the location to which the file will be exported?

               Unfortunately, you can't just pop up a file save dialog with the file name already entered as the filename.

               You could do one of the following without resorting to a plug in (one might offer the dialog option):

               You can set up a table of permitted locations for saving the file. The user clicks an option to select it and your file exports to that location.

               An open file dialog appears (not save) and the user selects a file (any file) from within that folder. The script uses the path to the selected file to compute the file path to the folder to use in the $Path variable. The funky part about this is that there must be at least one file already in the folder and the file that opens is actually used to insert the selected file into a container field in order to gain access to the needed file path.

          • 2. Re: Scripting file name for export to Excel
            user539

                 Currently it's hard wired as you could see to the desktop. I was just going to use a custom dialogue. They would like the ability to direct where the file is saved. The save as PDF file that is exported is huge and is so large that a special service uploads it to a corporate site across he country. Currently she has to save this huge file to her desktop and then copy it to another destination and then delete it from her desktop. Apparently the location can vary. I suppose there could be multiple choices. Maybe 1 Desktop, 2 Folder A, 3 Folder B.

                 I don't feel quite so foolish for not being able to resolve this one easily. The person who created the current script had brushed off the request for the change as being more trouble than it's worth.

                 I'd say so perhaps myself, but there are a number of places in our tools where an option would be really a time saver.

                 Thanks. Bill