• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Looping through a list question...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: [ANN] X-Commands 0.9
  • Next by Date: [Finder] Selection is broken (for single folders) insertion location is a work around
  • Previous by thread: Re: Looping through a list question...
  • Next by thread: Save from Photoshop as GIF with transparency?
  • Index(es):
    • Date
    • Thread