Intelligent Save Dialogue?

Paul Hibbert p.hibbert at saywardvalley.net
Tue Jan 31 12:51:01 EST 2012


Hi All,

I recently built a small application for capturing screen grabs with a few simple image editing/cropping options. I sent the app out to a small group of beta testers to get some feedback and check things over on different systems, most things have worked out reasonably well with just a couple of small bugs and a few requests, one request has me stumped, but also intrigued.

The app allows the user to save the final image as Gif, PNG or Jpeg using the 'with type' options in the ask file routine, but when the user chooses a different file type other than the default Gif, they have to manually change the file extension in the file name field. The request has come back to automatically change the file extension in the file name field, something like the way the save dialogue in PhotoShop works.

I included a trap to warn the user of filename/extension mismatches and correct the extension, but the only way I could figure out how to do that was, when the user clicks the 'Save' button, the dialogue box closes, the script can then check the result and the it variable then, if it detects a problem it would display a warning and present the user with a refreshed dialogue box with the correct details before actually writing the file to disk.

The problem here is that, as far as I know LiveCode can only react to the Save or Cancel button being pressed within the dialogue box, so my question for the list is:

Does anybody know of a way to achieve an 'intelligent' save dialogue without building a new one from scratch? or has anybody built one that they are willing to share?

Thanks for any advice,

Paul




More information about the use-livecode mailing list