• 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: Editing Lists of LISTS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Editing Lists of LISTS


  • Subject: Re: Editing Lists of LISTS
  • From: T&B <email@hidden>
  • Date: Sat, 19 Jan 2008 12:12:15 +1100

Hi Justin,

I'm trying to loop through a list of lists and I'm having trouble
accessing the inner lists---I get this error:

Can't make {{"purple"}, {"blue"}, {"black"}} into type integer.

That means that the loop you are using requires a number after the "to", eg:


repeat with i from 1 to 3

or:

repeat with i from 1 to count twoList

So you could do it like this:

repeat with i from 1 to count twoList
	repeat with j from 1 to count (item i in twoList)
		set item j in item i in twoList to "green"
	end repeat
end repeat

or you can use the reference form of a loop:

repeat with i in twoList
	repeat with j in i
		set contents of j to "green"
	end repeat
end repeat

Tom

_______________________________________________
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: 
 >Editing Lists of LISTS (From: "Justin Laden" <email@hidden>)

  • Prev by Date: Re: Get only the name of the file, instead of the whole path!
  • Next by Date: Plist entry
  • Previous by thread: Re: Editing Lists of LISTS
  • Next by thread: Re: Editing Lists of LISTS
  • Index(es):
    • Date
    • Thread