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

Editing Lists of LISTS


  • Subject: Editing Lists of LISTS
  • From: "Justin Laden" <email@hidden>
  • Date: Fri, 18 Jan 2008 15:33:43 -0500

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.

Here's my code--I'm just using short lists for testing purposes:

set testList to {{"1"}, {"2"}, {"3"}}
set twoList to {{"purple"}, {"blue"}, {"black"}}

repeat with i from 1 to (twoList)
	repeat with j from 1 to (twoList)
		set item j of list i of twoList to "green"
	end repeat
end repeat


Yet, when I DON"T loop through I can access the lists:

set item 1 of list 1 of twoList to "green"

This works--why?


Also, when I try:

repeat with i from 1 to (twoList)
	set item i of list i of twoList to "green"
end repeat

It doesn't work.

Thanks everyone!
 _______________________________________________
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

  • Follow-Ups:
    • Re: Editing Lists of LISTS
      • From: T&B <email@hidden>
    • Re: Editing Lists of LISTS
      • From: "Mark J. Reed" <email@hidden>
    • Re: Editing Lists of LISTS
      • From: Michelle Steiner <email@hidden>
  • Prev by Date: Re: Obfuscations and little white lies
  • Next by Date: Re: Should I not have avoided Leopard?
  • Previous by thread: Colloquy
  • Next by thread: Re: Editing Lists of LISTS
  • Index(es):
    • Date
    • Thread