Re: Looping through a list question...
Re: Looping through a list question...
- Subject: Re: Looping through a list question...
- From: has <email@hidden>
- Date: Tue, 5 Nov 2002 00:00:25 +0000
Gregory Smith wrote:
>
repeat with aFile in listOFiles as text
Need to be more careful tossing in them "good luck" coercions, I think<g>.
The above line will coerce 'listOfFiles' into a string and then iterate
across each item (character) in that string. Can't honestly see how it
could've worked at all... but anyway, here's a fixed up version:
======================================================================
set listOFileNames to name of every file in (alias pathToRevFolder)
[NO-BREAK]whose name ends with selectedFileSuffix
set versionCount to 0
if listOFileNames is not {} then
repeat with fileNameRef in listOFileNames
set versionFlag to character 7 of fileNameRef
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."
end if
======================================================================
HTH
has
--
http://www.barple.pwp.blueyonder.co.uk -- The Little Page of AppleScripts
_______________________________________________
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.