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.
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.
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.
1 of 1 people found this helpful
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,
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.