This would be the case for using lookup (or auto-enter calculation), not script.
If answering your question simply, unfortunately you need to make script for each file.
Congratulation, scripting is the most mind blow features of FileMaker. Scripts turned files into a program with data solutions..
What I would suggest is start a Navigation Script for buttons and layout... From a FM pro 11 starter solution.
Set Variable [$navCode:Value: Get (ScriptParameter)]
If [$navCode = "Name of Set Variable"
Go to Layout [Layout Name]
Else If [$navCode = "Name of Set Variable"]
You can added logon information, and Finds, Sorts etc.
I am thinking you are talking about multiple table in a file.
Keep me in the loop.
you should start with the filemaker training series. "files in the database" does not make much sense in this discussion.