Filter with more than one parameter
Bob Hartley
bob at armbase.com
Sun Jan 4 05:43:47 EST 2004
At 19:29 03/01/2004 -1000, you wrote:
>I think I'm missing something really simple:
OK here is how I did it with checkboxes. (with the help of sarah)
you can download the rev file from
http://www.gla.ac.uk/~rh82p/
and use an copy any bit of it you wish.
see screenshot here
http://www.gla.ac.uk/~rh82p/confocal.jpg
Cheers
bob
code below
global gHierList,gClickList,gjpgList,gbioradList,ggifList
on mouseUp
put empty into gHierList
put empty into field 1
answer folder "Pick a folder you want to walk:"
if it is empty then exit mouseUp
set lockCursor to true
set cursor to watch
directoryWalk it
put empty into newList
put gHierList into tempList
if the hilite of button "JPEG" then
filter tempList with "*.jpg"
put tempList & cr after newList
end if
put gHierList into tempList
if the hilite of button "BIORAD" then
filter tempList with "*raw*.pic"
put tempList & cr after newList
end if
put gHierList into tempList
if the hilite of button "GIF" then
filter tempList with "*.gif"
put tempList & cr after newList
end if
put gHierList into tempList
if the hilite of button "TIFF" then
filter tempList with "*.tif"
put tempList & cr after newList
end if
put gHierList into tempList
if the hilite of button "PSD" then
filter tempList with "*.psd"
put tempList & cr after newList
end if
put gHierList into tempList
if the hilite of button "BMP" then
filter tempList with "*.bmp"
put tempList & cr after newList
end if
put gHierList into tempList
if the hilite of button "REVOLUTION" then
filter tempList with "*.rev"
put tempList & cr after newList
end if
put gHierList into tempList
if the hilite of button "FREEHAND" then
filter tempList with "*.fh10"
put tempList & cr after newList
end if
put gHierList into tempList
if the hilite of button "WORD" then
filter tempList with "*.doc"
put tempList & cr after newList
end if
put gHierList into tempList
if the hilite of button "EXCEL" then
filter tempList with "*.xls"
put tempList & cr after newList
end if
put gHierList into tempList
if the hilite of button "POWERPOINT" then
filter tempList with "*.ppt"
put tempList & cr after newList
end if
put gHierList into tempList
if the hilite of button "ENDNOTE" then
filter tempList with "*.enl"
put tempList & cr after newList
end if
put newList into gHierList
put gHierList into field 1
put number of lines of fld 1
filter field 1 with "*?"
set lockCursor to false
end mouseUp
on directoryWalk whatFolder
set the defaultFolder to whatFolder
put the files into temp
repeat for each line x in temp
put whatFolder & "/" & x & return after gHierList
end repeat
put the folders into tDirList
repeat with x = 2 to the number of lines of tDirList
directoryWalk (whatFolder & "/" & (line x of tDirList))
end repeat
end directoryWalk
>on importPhotos gCurrentFolder
> set the directory to gCurrentFolder
> put the files into temp
> filter temp with "*.jpg,*.gif,*.png"
> put temp
>on importPhotos
>
>
>doesn't work, but
>
>filter temp with "*.jpg"
>
>does work... What am I doing wrong? Can we not filter a container with
>multiple criteria in a single pass? I couldn't see how to use a
>wildCardExpression for this and the command doesn't support full regEx,
>which could do the job. I searched and searched the docs but no answer
>that applies to filtering a container, just platform specific stuff for
>answer file. I would also like to filter file lists for
>"*.html,*.txt,*.shtml,*.xml,*.htm.*indd" in one pass as well.
>
>Of course we can do the following, but it seems like a lot more than
>should be needed:
>
>on importPhotos gCurrentFolder
> set the directory to gCurrentFolder
> put the files into temp
> put temp into tOnlyJpegs
> put temp into tOnlyGifs
> put temp into tOnlyPngs
> filter tOnlyJpegs with "*.jpg"
> filter tOnlyGifs with "*.gif"
> filter tOnlyPngs with "*.png"
> put tOnlyJpegs & cr & tOnlyGifs & cr& tOnlyPngs into _allPix
> put _allPix
>on importPhotos
>
>??
>
>Sannyasin Sivakatirswami
>Himalayan Academy Publications
>at Kauai's Hindu Monastery
>katir at hindu.org
>
>www.HimalayanAcademy.com,
>www.HinduismToday.com
>www.Gurudeva.org
>www.Hindu.org
>
>_______________________________________________
>use-revolution mailing list
>use-revolution at lists.runrev.com
>http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list