Creating a list...

Hello Gurus,

I’m having trouble taking a group of files out of a larger list and using just those files for a test. For the sake of getting filenames, I want Eggplant to ignore things like DS_Store files and the various and sundry other hidden files in a directory.

Here specifically is what I’m trying to do:

set MyDir to  "/path/to/folder"
put files(MyDir) into filesToSort
set theitemdelimiter to "'"
repeat with each TIFF of filesToSort
	if TIFF ends with ".tiff" then
		add TIFF to tiffFiles
		end if
end repeat

Problem is, the ADD command expects numbers, obviously. I just want to go through a directory and say "OK, put this file in the list, Ignore that one, put these two in, etc, etc. Any thoughts?


Hi, Allen:

Almost there. Here’s the code:

repeat with each TIFF of filesToSort 
? ?if TIFF ends with ".tiff" then 
? ?? ?insert TIFF after tiffFiles 
? ??end if 
end repeat

That should do it.