Looping through a list question...
Looping through a list question...
- Subject: Looping through a list question...
- From: "Gregory Smith" <email@hidden>
- Date: Mon, 04 Nov 2002 14:24:23 -0800
Hello Everyone,
Okay, I know this will probably be a dumb one on my part, but why can't I
loop through a list with only one item with out the looping 'seeing' the
single var as a list of text items???
-=-=- Begin Code -=-=-=-
-- some code
set listOFiles to name of every file in alias pathToRevFolder whose ,
name ends with selectedFileSuffix -- Get a list of all file names in
the 'Rev' folder
if (count of listOFiles) is not {} then
set versionCount to 0
repeat with aFile in listOFiles as text
--set aFile to aFile as text
set versionFlag to item 7 of aFile
if versionFlag is selectedFileVersion then
set versionCount to (versionCount + 1)
end if
end repeat
else
display dialog "No matching files types or revs in rev folder." as text
end if
-- more code
-=-=- End Code -=-=-=-
In the past, I remember simply just setting the var of the loop to be a text
item and away I went. What am I overlooking here? Code above works with an
empty list or a list of more than two vars. Only breaks (at --> set
versionFlag to item 7 of aFile) with one var (item) in list.
Thanks in advance for your help.
--
Cheers,
Greg
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.