A save question in an app

J. Landman Gay jacque at hyperactivesw.com
Thu Jun 30 00:27:34 EDT 2011


Charles Szasz wrote:

> When an user saves a file, the user is presented with a file dialog
> that has "Untitled.datatxt" hilited in the Save As dialog. Is there
> anyway that only Untitled can be hilited so that the user enters a
> name for the file but the .datatxt extension is automatically saved
> to the file name selected by the user?

Just leave it off the prompt, and add it back in after they choose a 
name. Something like this:

  ask file "Save file as: " with (tNewFolder & "/Untitled")
  put it into tSaveFile
  if tSaveFile is empty then exit to top
  put gatherData(tCardName) into URL ("file:" & tSaveFile & ".datatxt")

You should probably add a check to see whether the extension is already 
in the name they typed before you add it again yourself.

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




More information about the use-livecode mailing list