Selecting an image file

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!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
exheusden
Posts: 170
Joined: Fri Oct 09, 2009 5:03 pm
Contact:

Selecting an image file

Post by exheusden » Thu Jun 06, 2013 12:39 pm

I want to allow the selection of either a jpg or a png image file. I use the following code:

answer file "Choose original label image:" with type "Image files|jpg|JPEG|png|PNG|"

(I've tried it with and without the final vertical bar), but only jpg documents are selectable in the resulting file list, png files being greyed out.

How can I make the pngs selectable, too?

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Selecting an image file

Post by Klaus » Thu Jun 06, 2013 12:48 pm

Hi exheusden,

do this:
...
answer file "Choose original label image:" with type "Image files|jpg,png|JPEG,PNGf"
...
:-)

With "itemdel = |" the second ITEM is a COMMA separated list of FILE suffixes you want to allow.
The last item is only neccessary for older machines, since Apple will go away from FILETYPES like
in the old days, but will use file suffixes today.


Best

Klaus

exheusden
Posts: 170
Joined: Fri Oct 09, 2009 5:03 pm
Contact:

Re: Selecting an image file

Post by exheusden » Thu Jun 06, 2013 1:16 pm

Thank you very much, Klaus. It now works!

Post Reply