A save question in an app
m.schonewille at economy-x-talk.com
Wed Jun 29 19:58:28 EDT 2011
No. You can't do that. Not even with Applescript. Currently, you'd need an external to do that.
Usually, I check whether the user deleted the file extension. If yes, then I add the file extension again and check to see if the file already exists. If the files exists, I show the user an error message and leave it with that. The user will have to try saving again and will hopefully have learned not to delete the file extension.
On Mac OS X, you don't really need file extensions. You could do with file type and creator.
Economy-x-Talk Consulting and Software Engineering
New: Download the Installer Maker Plugin 1.6 for LiveCode here http://qery.us/ce
On 30 jun 2011, at 01:31, Charles Szasz wrote:
> I have the following code in my save handler:
> if there is not a folder tNewFolder then
> create folder tNewFolder
> end if
> ask file "Save file as: " with (tNewFolder & "/Untitled.datatxt")
> put it into tSaveFile
> if tSaveFile is empty then exit to top
> put gatherData(tCardName) into URL ("file:" & tSaveFile)
> end if
> 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?
> Charles Szasz
> cszasz at mac.com
More information about the Use-livecode