I have a 2 column table in a drawer. When I open the drawer I want the table values to be filled in from a list. My error is “NSContainerSpecifierError (2)”, so I think the error is in the line of code… tell data source of table view “savedFilesTable” of scroll view “savedFilesTable”
Any ideas where I’ve gone wrong? Do you see any other errors?
–Here’s what I’ve got.
–for the containers
drawer name: drawer
window name of drawer: theReader
–for the table
nsscrollview: savedFilesTable
nstableview: savedFilesTable
column 1 name: bookName
column 2 name: paraNum
– my code
on opened theObject
if theObject is drawer "drawer" of window "theReader" then
tell theObject
set myList to {"Amendments", "7", "History Of The United States", "244", "Jfk'S Inaugural Address", "2"}
tell data source of table view "savedFilesTable" of scroll view "savedFilesTable"
make new data column at the end of data columns with properties {name:"bookName"}
make new data column at the end of data columns with properties {name:"paraNum"}
set count_items to count of myList
repeat with b from 1 to count_items by 2
set theRow to make new data row at the end of data rows
set this_saved_file_name to (item b of myList) as string
set this_saved_para_num to (item (b + 1) of myList) as string
set contents of data cell "bookName" of theRow to this_saved_file_name
set contents of data cell "paraNum" of theRow to this_saved_para_num
end repeat
end tell
end tell
end if
end opened