Problem saving files

J. Landman Gay jacque at hyperactivesw.com
Tue Jul 6 09:50:35 CDT 2010


David C. wrote:

> I'm using filter so that the user will see only the files with like
> extensions, but I've tried it without the filtering as well, with no
> luck. I think the heart of the issue is that when asked if the user
> wants to overwrite a file and they affirm that they do...
> 
> ..the file *should* be overwritten instead of duplicating the name
> with a doubled up extension.

I think Sarah's right, your code isn't checking to see if the file 
already has the same extension. Add this to your "save" handler after 
you get the user's file name:

put ".ext" into tExtension -- use yours
set the itemDelimiter to "."
if last item of tFileName <> tExtension
then put tExension after tFilename

Now you shouldn't get duplicate extensions and if the file exists it 
will be overwritten.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list