Don't load a file that is not an image

Klaus Major klaus at major-k.de
Thu Mar 2 09:24:10 CST 2006


Hi Reinhold,

> Hi!
>
> I think  >  answer file "Select an image:" with type "..." <  works  
> well on Macs. But when I get an image from a Win-User, the image  
> has no type.

please trust Ken, he knows what he is doing! :-)

This new (since REV/MC 2.6 i think...) snytax is crossplatform actually!

...
answer file "Select an image:" with type "Images|jpg,gif,png| 
JPEG,GIFf,PNGf"
...

will work as good on a Mac as on windows and only allow GIF, JPEG or  
PNG files :-)

> I will follow the advice of Klaus "catch errornum"

Thank you, very appreciated, but not neceassary :-D

> Thanks
> Reinhold
>
>
> Am 27.02.2006 um 19:00 schrieb Ken Ray:
>
>>> I wrote a script to load an image, but when I select a file, that is
>>> not an image, I get an error message.
>>>
>>> How can I avoid the selection of a wrong file.
>>> This script don't works:
>>> on mouseUp
>>>    answer file "Please select an image:"
>>
>> Check out the "answer file with type" entry in the docs - you can  
>> limit the
>> selections for the user to only images... something like:
>> answer file "Select an image:" with type "All
>> Images|jpg,gif,png|JPEG,GIFf,PNGf"
>>
>> ... etc.

Best

Klaus Major
klaus at major-k.de
http://www.major-k.de



More information about the metacard mailing list