Don't load a file that is not an image

Reinhold Venzl-Schubert r.venzl-schubert at t-online.de
Mon Feb 27 06:11:29 CST 2006


Hi!

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:"
   put it into Importpicture
   if Importpicture is empty then
     answer "You did not select an image."
     exit mouseup
   end if

?  if ImportPicture is no image then
?    answer "This is not an image. It cannot be loaded."
?    exit mouseup
?  end if

   import paint from file Importpicture
end mouseUp

I did not find any help in help

Reinhold


More information about the metacard mailing list