File lists

Richmond richmondmathewson at
Sun Jul 11 17:34:09 EDT 2010

  On 07/11/2010 11:53 PM, J. Landman Gay wrote:
> I need to get a list files in a folder and display it in a card field. 
> The function "the files" doesn't detect OS X "bundle"-type files such 
> as rtfd and Pages documents. Before I reinvent the wheel, does anyone 
> have a script for getting a full file list that includes these special 
> OS X files?
> And secondly, since "answer file" does include bundle-type files, 
> shouldn't "the files" detect them too?
> Grumble.

Set up 2 fields:  "fFILES" and "fFOLDERS" and pop this into a button:

on mouseUp
    put empty into fld "fFILES"
    put empty into fld "fFOLDERS"
    put the files into fld "fFILES"
    put return after fld "fFILES"
    put the folders into fld "fFOLDERS"
    put the number of lines of fld "fFOLDERS" into vFOLDERLINES
    repeat with vCOUNT = 1 to vFOLDERLINES
       put line vCOUNT of fld "fFOLDERS" into sFOLDER
       if sFOLDER contains ".app" then
          put sFOLDER after fld "fFILES"
          put return after fld "fFILES"
          end if
    end repeat
end mouseUp

fairly crude; but what else can you expect in 10 mniutes.

If you want to say Thank you, you can explain
why one cannot copy paste from the script editor on Linux
into anything!!!!!

More information about the Use-livecode mailing list