Using Apple’s “Table” → “with data source” example project as a reference, I am trying to build a project with a table. However I keep getting the error:
Below is the code I am using. It is a virtual copy-paste from Apple’s example (which works just fine of course) The UI is just a two column table and a button.
What in the heck am I doing wrong?
property filesDataSource : null
on will open theObject
set filesDataSource to data source of table view "file_list" of scroll view "file_list" of theObject
tell filesDataSource
make new data column at the end of the data columns with properties {name:"file_path"}
make new data column at the end of the data columns with properties {name:"file_count"}
end tell
end will open
on clicked theObject
if name of theObject is equal to "button" then
--Error seems to be caused by this next statement.
set theRow to make new data row at the end of the data rows of filesDataSource
tell window of theObject
set contents of data cell "file_path" of theRow to "Some text"
set contents of data cell "file_count" of theRow to "Some different text"
end tell
end if
end clicked
Thanks!!