Save file dialogs...
Paul Dupuis
paul at researchware.com
Mon Oct 23 10:53:50 EDT 2017
In our application we often provide our customers with the ability to
save information in a variety of formats using a code snippet such as:
put "YourData.txt" into tDefaultFileName
put "Save some data as:" into tPrompt
put the defaultFolder &slash& tDefaultFileName into tDefaultFilePath
put "Plain Text|txt"&cr&"Rich Text|rtf"&cr&"Microsoft Word|docx" into
tTypes
ask file tPrompt with tDefaultFilePath with type tTypes
put it & cr & the result into fld 1
Note that "it" contains the file path and "the result" contains the type
selected (Plain Text, Word, RTF, whatever)
It has been pointed out that most other application, on either OSX or
Windows, in a save file dialog, dynamically change the file extension
when a different type is selected from the save file popup menu. For
example, in the above code, if the use is initially presented with
"YourData.txt" and "Plain Text" as the type. If the user selected
"Microsoft Word" the extension presented in the dialog is not changed to
.docx dynamically. This does happen in most other commercial
applications (i.e. MS Word).
You do get back the chosen type in the result, but only after the dialog
has been closed. You can use this to change the extension after the
fact, but apparently not dynamically.
This behavior exists in at least 6.7.11 through 8.1.6 under both OSX and
Windows
Questions for the community AND/OR the LiveCode mothership:
1) Is this a "bug"?
2) Is there any work around (like a secret callback message) to detect
when the popup type menu has been changed to dynamically update the
presented file name's extension?
3) Has anyone else in the community run into this and cares about it or
are my customers just being way to picky?
More information about the use-livecode
mailing list