Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
on mouseUp pMouseBtnNo
ask file "Export picture as:" with type "JPEG File|jpg|JPEG" or type "GIF File|gif|GIFf"
put the result into tType
put it into trep
answer tType & cr & cr & trep
end mouseUp
Hi Chaumaret,
The problem here is that Revolution's save file dialog doesn't automatically check for the file extension. If the user types "myfile.gif" in the filen name field in the dialog, the result may contain JPEG. You'll have to check both the result and the file name. Personally, I wouldn't warn the user if an inconsistent choice has been made. I'd just let the file name prevail.
constant dot = "."
on mouseUp pMouseBtnNo
ask file "Export picture as:" with type "JPEG File|jpg,jpeg|JPEG" or type "GIF File|gif|GIFf"
put the result into rslt
set the itemDel to dot
if last item of it is "gif" or last item of it is among the items of "jpeg.jpg" then
put it into trep
put last item of it into tType -- this type is different from Bernd's script
else if rslt contains "gif" then
put it into trep
put "gif" into tType -- this type is different from Bernd's script
else if rslt contains "jpeg" then
put it into trep
put "jpg" into tType -- this type is different from Bernd's script
end if
answer tType & cr & cr & trep
end mouseUp
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode