How does "ask file with type" work?
Trevor DeVore
lists at mangomultimedia.com
Wed Apr 11 12:53:59 EDT 2007
I just finished dealing with a support issue on Windows related to
this so I want to add some additional notes.
On Apr 6, 2007, at 7:49 AM, Richard Gaskin wrote:
> If you supply a default name, the name portion preceding the file
> name extension is selected, preserving the file type extension.
> That works well.
This works on OS X but not Windows. On Windows the entire file name
(including extension) is selected. If the user just starts typing
away then the extension is lost. This seems to be the standard
behavior with other Windows applications but see below.
> So this comes down to Dave's suggestion that the ask file command
> somehow force a file type extension when the user has deleted it
> from the prompt, and also provide its own notification of any
> conflicts with existing files.
>
> OS X allows the developer to supply a file extension, and Rev
> provides a means for doing that. But apparently the OS doesn't
> prevent the user from going out of their way to delete file type
> extensions in its dialog, and the "ask file" command (when used
> outside of the Message Box) faithfully returns exactly what the
> user entered.
I just tested Notepad and SnagIt on Windows. The behavior in ask
file dialogs is to automatically append the extension of the
currently selected "Save as type:". In Notepad I tried to save a file
as "test" in a folder that had a "test.txt" file already. I clicked
the "Save" button and was immediately presented with a dialog asking
if I wanted to replace "test.txt" (ask dialog did not disappear).
So on Windows I think the file extension of the currently selected
"Save as type:" should be automatically appended to the file name. On
Mac I think the current behavior is correct since file extensions
aren't required.
The fact that lots of us are writing cross-platform software means
some of us might want to enforce file extensions so the files can
travel between different operating systems easily enough. Maybe an
option to force the extension on OS X would be nice as well. We can
do it manually now but it would be nice to not have to add the extra
code to check each time.
--
Trevor DeVore
Blue Mango Learning Systems
www.bluemangolearning.com - www.screensteps.com
trevor at bluemangolearning.com
More information about the use-livecode
mailing list