Re: Editing Lists of LISTS
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