How does "ask file with type" work?

Dave dave at looktowindward.com
Thu Apr 5 11:28:54 EDT 2007


On 5 Apr 2007, at 16:00, Henk van der Velden wrote:

> Hi Dave,
>
> There is a sample stack "FileFiltering" at my userspace "henk" at  
> Revonline, showing the different options of the answer file command.
>
> If you know the extension of the file that is going to be saved,  
> you could check whether an extension is added to the filename of  
> not. If there's no extension, you could add it to the filename by  
> script, and then do the file save.
>
> Hope this helps,
> Henk
>

Thanks a lot, the problem with adding the extension outside the  
choose file dialog is that if the file already exist it then bypasses  
the "Replace File" Dialog that is displayed inside the choose file  
dialog. e.g.

Choose File Dialog, User enters "Fred"   (Fred.rev already exists),  
but since the .rev extension is not added until after the dialog is  
dismissed the "replace file" warning dialog is not shown. Then the  
user script adds the .rev, it has to check if the file exists and  
then display a dialog of it's own. This gives an inconsistent  
interface to the user and is generally bad GUI practice.

I was wondering if there is a way to get the ask file dialog to  
append the file extension, that why the check for the file being  
replaced would be handled just once and would therefore give  
consistent results.

All the Best
Dave
>
>>
>> How does "ask file with type" work?
>> Dave
>> Thu, 05 Apr 2007 04:46:41 -0700
>>
>> Hi,
>>
>> I have a script with the following ask statement:
>>
>> ask file "Enter Name of New Script File" with myScriptFolderPath  
>> with type "rev"
>> What is this supposed to do?
>>
>> This is what I want to happen:
>>
>> The choose file dialog is displayed.
>> The user enters a file name with or without an extension (or is  
>> forced to enter an extension) and the extension appended to file  
>> name.
>> If the file exists they are prompted to replace the current file  
>> or not.
>>
>> At the moment, if the user enters a file without an extension this  
>> name is passed back. This is ok and it's easy to handle, but it  
>> means that I will have two different "File Exists, Replace this  
>> file?" dialogs which is messy and inconsistent.
>>
>> The alternative is to do my own choose file dialog, but it will be  
>> a lot of work to replicate the OS Version, especially when running  
>> on multiple platforms.
>> Any ideas or suggestions?
>>
>> All the Best
>> Dave
>>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list