In the project window, go to Project=>Settings and there you will see an On Open script box that you can place a script into.
Concerning a Table Script that run when a data table is opened, create a table script and name it "On Open" and it will run when the data table is opened.
Jim