• 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: Kurt Klamp <email@hidden>
  • Date: Mon, 20 Aug 2007 00:02:00 +0200


Am 19.08.2007 um 23:54 schrieb Patrik B.:

How do I do a repeat through two lists at the same time:

Example I have two lists

set list1 to {1,2,3,4,5,6}

set list2 to {"1a","2a","3a","4a"}

repeat with i in list1
repeat with j in list2
-- do action with 1 and 1a
-- do action with 2 and 2a etc.-- the way the repeat is worded now is it will give me 1-6 with 1a and then 2a but I want to progress through both lists at
the same time.
end
end

repeat with i from 1 to (count list1) -- assumes that both lists are equal in length
--do action with (get item i of list1)
--do action with (get item i of list2)
end repeat


Kurt
_______________________________________________
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
References: 
 >How to step through two lists at the same time? (From: "Patrik B." <email@hidden>)

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