Get dataSource from a table view

If I want to access the dataSource of a tableView without connecting the actual table to the script, then how can I retrieve it with code.

I tried:

set theSource to aTableView's dataSource()

but this returns an error, how do you retrieve it because I know you could with Applescript Studio.

You mean without making an outlet property for the table? With some difficulty…

Yes without it as an outlet because it is already an outlet for a separate script.

You can connect one object to multiple controllers, you know. At least you can with Objective-C. And otherwise there’s always the option to set an identifier, but than you’d have to get the main window, process its subviews, process those subviews, and so on…

The dataSource of the tableView can only be connected to one object so if you cannot connect it to both objects this has to be done with code.

But you can connect the table to multiple objects. Only one object can be the dataSource, though, however you do it.