This sounds right - though I have two tables, each with it’s own array controller. Table 2’s contents are bound to table 1’s selection and I also have a bunch of user preferences that are bound to table 1’s selection. So changing selection in table 1 changes the list in the other table and also the prefs values in the app.
I can’t bind the prefs values, for example, to my script variables because they are already bound to the Array Controller for table 1. And I have to “get” the values of the list items in table 2 by the lines indicated earlier
This is all set up with minimal code using several class files and the controllers. But"getting" and “setting” are a pain.
So I hope there is a simpler way because now I am trying to manually “set” the values for a new row in table 2 via the + button with this example which fails so far:
on addFilesToListTable_(sender)
set theKeys to NSArray's arrayWithObjects_("address", "subject")
set theVals to NSArray's arrayWithObjects_("someaddress", "somesubject")
set newDictinaryObject to NSMutableDictionary's alloc()'s initWithObjects_forKeys_(theVals, theKeys)
Sourcef's addObject_(newDictinaryObject)
end addFilesToListTable_
It does enter a new row but it is blank. I tried adding the required “nil” to the end of the lists, putting them in brackets etc. but no luck.
The bindings work great but accessing the tables is tricky without those nice bound variables in the script.
Oh no!
help.
Rob