Opening a window on Windows?

Martin Baxter martin at materiaprima.fsnet.co.uk
Fri Apr 9 13:00:08 EDT 2004


Hello Ian,

Depends what you mean by "a window". If you mean a file selection dialog,
you could use:

answer file "select a jpeg" with filter "JPEG Files,*.jpg,*.jpeg"

or if you want to get a list of files in a folder and display it in a
window of your own you could use the files() function and filter lines of
the result for the extension your app writes (ie .jpg or .jpeg)
(Though, if your app created the files, it might be possible to just build
a list internally as it creates them ?)

### e.g. (untested)

put the defaultfolder into keepdefault
set the defaultfolder to "theimagefolder"
put the files into tFileList
set the defaultfolder to keepdefault

##now you have a list of all the files in the folder
##if the folder only has your jpegs in it then you're OK
##otherwise you could...
##filter for the ones that contain .jpg or .jpeg

filter tFileList with "*.jpg"
#or
filter tFileList with "*.jpeg"
#depending which of these your app used

/*tFileList should now be a list of the jpegs in the selected folder*/

HTH

Martin

>I want to open a window to show the user a load of new JPEG files that
>have just been generated by my app.  On Mac this is easily achieved
>with a couple of lines of AppleScript.  Is there any way of recreating
>this on Windows?
>
>Thanks in advance for any tips,
>
>Ian




More information about the use-livecode mailing list