Changing Object Colours with Applescript

Hi Shane,

Heres what Ive done:
Added an Array Controller called ‘Import Table’
Added my Headers as keys in the object controller under the new array controller (Colour_Ref_I, A, B)
Set the content controller in the array controller to bind to Delegate with self.importController as the model key.
Declared importController as a property
Bound each column value to the array controllers ‘Import Table’ with arrangedObjects as the controller key and Model key path as the keys from the array controller (Colour_Ref_I, A, B)

Code to populate

property NSArray : class "NSArray"
property NSMutableArray : class "NSMutableArray"

set myData to {{A:"Test",B:"Test Again",Colour_Ref_I:"Test Again Again"}}

set my importController to NSArray's arrayWithArray:myData --> Populates A and B but no Colour_Ref_I
set my importController to NSMutableArray's arrayWithArray:myData --> Populates A and B but no Colour_Ref_I --> Populates A and B but no Colour_Ref_I

    on buttonClick_(Sender)
        
        importController's addObject:{A:"2",B:"3",Colour_Ref_I}
-- If NSArray's then it returns the error
-- If NSMutableArray it return no error but also appears to do nothing.
 
    end buttonClick_

Thanks

OK.

Unnecessary, but doesn’t hurt.

No – the model key path should the name of the property that stores the data (the self. is optional).

And connected it as an outlet for the array controller?

Yes.

You also need a property to hold the data.

That’s just changing a property from being a reference to an array controller to being and array – that makes no sense.