Updating multiple TextView objects

Hello all,

Is there a way of keeping a reference or list of properties (linked to button or TextView objects) or a way of doing the below?
For example,

I have a window with 3 different TextView objects connected to the below properties, I can update their text using:

property textViewItem_1 : missing value
property textViewItem_2 : missing value
property textViewItem_3 : missing value

textViewItem_1’s setStringValue : “test1”
textViewItem_2’s setStringValue : “test2”
textViewItem_3’s setStringValue : “test3”

Is there a way I can set their value in a loop? Something like:

repeat with a from 1 to 3
textViewItem_(a)'s setStringValue : “test” & a
end repeat

Is this possible?

To use a loop you have to create a list with the text items


property textViewItem_1 : missing value
property textViewItem_2 : missing value
property textViewItem_3 : missing value

set textItems to {textViewItem_1, textViewItem_2, textViewItem_3}

repeat with a from 1 to count textItems
	set currentItem to item a of textItems
	(currentItem's setStringValue:("test" & a))
end repeat

Hello StefanK,

That worked, thank you very much!

You could also in interface builder bind them to
The Class
With the key of the Property in the Class