• 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: How to step through two lists at the same time?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to step through two lists at the same time?


  • Subject: Re: How to step through two lists at the same time?
  • From: "Stockly, Ed" <email@hidden>
  • Date: Mon, 20 Aug 2007 10:57:12 -0700
  • Thread-topic: How to step through two lists at the same time?

> Since list1 and list2 are different sizes, what do you want to do for the 5th
and 6th iterations?  Skip them?  Have 5 and 6 with nothing? Cycle back to 5+1a
and 6+2a?

Here's another method that may work...

set list1 to {1, 2, 3, 4, 5, 6}
set list2 to {"1a", "2a", "3a", "4a"}
set x to 1
set list1Size to count list1
set list2Size to count list2
repeat
    if x < list1Size + 1 then
        set list1Item to item x of list1
        --do your thing
    end if

    if x < list2Size + 1 then
        set list1Item to item x of list2
        --do your thing
    end if
    set x to x + 1
end repeat

HTH

Ed
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Re: Saving Attachements to a folder
  • Next by Date: Re: Saving Attachements to a folder
  • Previous by thread: Re: How to step through two lists at the same time?
  • Next by thread: using rsync
  • Index(es):
    • Date
    • Thread