Save file dialogs...

Ralph DiMola rdimola at
Mon Oct 23 13:10:18 EDT 2017

In Windows you can add a hook into the open/save file dialogs. You get call backs for various events including changing the file type. I don’t know about Mac/Linux but I would assume the same(but different) facilities exist. Accessing the windows hooks would of course require changes to the engine. In Windows you can also get a callback when the user clicks the save/open/cancel before the dialog is closed.

Ralph DiMola
IT Director
Evergreen Information Services
rdimola at

-----Original Message-----
From: use-livecode [mailto:use-livecode-bounces at] On Behalf Of Brian Milby via use-livecode
Sent: Monday, October 23, 2017 12:32 PM
To: How to use LiveCode
Cc: Brian Milby
Subject: Re: Save file dialogs...

One option would be to leave the extension off when initially presented to the user. Then add the correct extension before saving if the user did not manually add one. It is probably a little more complicated than that though... unless the user has their OS set to display extensions, they may not be presented with them normally. I’m not sure if that is detectable from within LC though.

At least on Mac this would require a change in the engine source to have extensions change in the dialog.
On Mon, Oct 23, 2017 at 9:54 AM Paul Dupuis via use-livecode < use-livecode at> wrote:

> 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?
> _______________________________________________
> use-livecode mailing list
> use-livecode at
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
use-livecode mailing list
use-livecode at
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:

More information about the use-livecode mailing list