Does 'export image to file' give any warnings?
Graham Samuel
livfoss at mac.com
Thu Jan 26 12:18:00 EST 2012
I'm using 'export image' to put an image into a file without invoking a 'save' dialog - this is what my user wants. However, I can't see any obvious way of knowing that the new image has the same name has an existing one and would therefore overwrite it. I set up a button that does
on mouseUp
put the defaultFolder into temp
export img "ThePic"to URL ("binfile:" & temp &"/meagain.jpg") as JPEG
put "it= " &&"; result="&&(the result)
end mouseUp
However may times I do this, I always get the file "meagain.jpg" with no indication of any difference between the first and subsequent invocations.
Obviously I can search the directory myself to look for the recurrence of the file name, and I guess that's what I'm going to do,but I wondered if anyone knows if this form of statement in LC produces any kind of error message and if so, how one can detect it. After all, any kind of 'write file' operation can fail.
TIA
Graham
More information about the use-livecode
mailing list