5 Replies Latest reply on Jan 12, 2012 10:14 AM by joel.s

    FMP11 Preloading Save File dialog for export

    joel.s

      When saving a file as part of an export script, the two choices of either automating the whole process so that the save file dialog never appears (Specify Output File) or fully manual where the user has to do everything, is not quite what I am after.

       

      Is it possible to have the save file dialog be displayed but preload the filename from a local variable, the file type, path and whether the file opens automatically?

       

      For the user, most of the time these presets would be accepted but there will be occasions when a different location or file type is required and it would be a shame to have to provide two paths to saving an export file to handle these alternatives, especially given the errors this will encourage with file name etc.

       

      Ideally, I am thinking that I would like to see a checkbox in the Specify Output File dialog to display the save file dialog or not.

       

      The Export order will always be the same so can be handled without a dialog.

        • 1. Re: FMP11 Preloading Save File dialog for export
          joel.s

          OK, it looks like that is not possible, so my solution has been to display a simple dialog that asks the user to choose between an automatic save with a prebuilt name in the preferred format to the Desktop, or a fully manual save where the user can do anything but the export field order is fixed.

           

          It's a shame the file name cannot be supplied by the script but I'll post a request for future versions of FileMaker Pro along the lines of enabling the display of the save file dialog with the calculated values.

           

          Joel.

          • 2. Re: FMP11 Preloading Save File dialog for export
            Stephen Huston

            Hi Joel,

             

            In your option to save with a "prebuilt" name, the file name IS being supplied by the script.

             

            You can define a variable ($saveAs) via a calculation which includes the file path, so it is dynamic based on whatever info you choose from available data or conditions, and set the file to be saved without dialog to $saveAs. I use this technique all the time to save date-stamped report names to the desktop.

             

            The  option that is currently hardest to do is to let the user define the file name to be used and still save it to the desktop automatically. This requires some globals, dialog boxes, and then setting the $saveAs filepath based on the chose name, after making sure it is all legal characters. It's a little less reliable, but generally works.

             

            Stephen Huston

            • 3. Re: FMP11 Preloading Save File dialog for export
              joel.s

              Hi Steve,

               

              Thanks, that is what I have been doing and when a fully automated option is the only one that is necessary, setting all aspects of the export in the script works very well.

               

              What I wanted in this case was to have the same level of control AND display the put file dialog, so the user would have everything set, ready to just hit OK most of the time. When a different name, location or file type was required, they would make that change and then save, knowing the other parameters would be correct.

               

              I can do this kind of thing in other scripting environments so was hoping to find a similar solution for FileMaker Pro.

               

              Joel.

              • 4. Re: FMP11 Preloading Save File dialog for export
                Stephen Huston

                Hi Joel,

                 

                As I mentioned, another alternative, or an option built into the script, with a dialog to choose that option is:

                • The  option that is currently hardest to do is to let the user define the file name to be used and still save it to the desktop automatically. This requires some globals, dialog boxes, and then setting the $saveAs filepath based on the chose name, after making sure it is all legal characters. It's a little less reliable, but generally works.

                 

                However, if you want to give users the option of where to save the file manually, you cannot currently include automatic file naming.

                 

                You can use dialogs and globals to let them set the file name as they want (then strip out any problem characters), then create the $variable path to the desktop -- as long as you still save to the desktop (or some other consistent and always-available destination) in the path.

                 

                You can let them pick the name as long as you still pick the location. If you let them pick the location, you do lose control of the file naming.

                 

                I wish it were different, but revealing the "Save As" dialog to the user disables the ability to control or set the file name at the same time.

                 

                Sorry about that,

                Stephen Huston

                1 of 1 people found this helpful
                • 5. Re: FMP11 Preloading Save File dialog for export
                  joel.s

                  Steve,

                   

                  Thanks for the clarification.

                   

                  I'll go with the compromise I have designed which deals with 90% of the automatic saves and allows the user some options via the manual save file dialog when necessary.

                   

                  I just hate unnecessary dialogs and alerts which makes it look like the application is whining at the user to make decisions or acknowledgements when it should be anticipating the next move as much as possible. I am adding a message field to many of my layouts so that non-urgent information can be displayed without it getting in the way, removing all but a few alerts in my solutions.

                   

                  Joel.