Ask file: can I force the user to use an extension?

Ken Ray kray at sonsothunder.com
Tue Feb 28 16:05:49 EST 2012


> Now say there is already such a file in the directory. Of course I can detect it (by 'there is a') and warn the user, but only in a separate, home-grown dialog (an 'ask' dialog) after the Save dialog has been dismissed. This is clumsy and odd as a user experience. Is there any way I can hack into the conventional Save dialog so that it thinks it is being asked to save a file with an extension in spite of my user not typing one?

No, unfortunately. At the moment the easiest workaround (sans creating a custom Save dialog of your own) is to bring up the Save dialog, look at the name they entered, and if it doesn't have the right extension, add it and check to see if there's a file by that name already in the destination folder. If so, bring up a custom "do you want to overwrite" dialog.

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/	




More information about the use-livecode mailing list