Put the find script in the other file and use Perform find in your first file to specify the script in the second file.
With regards to accounts/passwords. If you use a script to directly or indirectly open a second file, Filemaker first attempts to open the file with the same account name and password used to open the original file. If there is a matching account name and password, the file will open without asking for a password. If there is no matching account name/password, the password dialog should appear.
How am I supposed to pass the agentID from the script in the first database to the script in the second database?
Nevermind I just found it: Get(ScriptParameter)
I am trying to acomplish the same thing on Filemaker 11, can you show an example of how you got your script to work?
So far I have a button that performs the following script:
Perform Find[Restore] - in the requests I have: Action= Find Records, Criteria= Computer Library::User [ = ]
Select Window [Name: "Computer Library"]
Under "Optional script parameter" i have:
Thanks in advance
In layout mode, double click the button, and click specify...
At the bottom of the dialog is a box for entering the value(s) you want to pass to your script as a parameter.
You can enter a literal value or click the edit button and specify a calculation such as the name of a field that contains the value.
In your script, you do this:
Go To layout [//Specify a layout based on the table you want to search]
Enter Find Mode  //no specified criteria, no pause
Set Field [YourTable::YourField ; Get ( ScriptParameter ) ]
Set Error Capture [on]
Perform Find 
I tried to replicate the settings but it hasn't worked for me.
here are my settings:
current script options: pause.
Original script parameter: Personnel Records::Name First Last
The script specified does this:
Open File ["Computers"]
Go to Layout[Computer Library::User]
Enter Find Mode
Set Field[Computer Library::User[ Get(Script Parameter) ] ]
Set Error Capture[On]
Your script will search a table in your current file. If you want to search records in an external file, the script has to be in the second file.
Open your second file and put the steps starting with Go To Layout in a script in this second file.
When you add the button or double click it while in layout mode to bring up the button setup dialog,
You select perform script and click Specify... to bring up the specify dialog. Then you select the second file from the drop down at the top of this dialog. If your second file isn't listed in the drop down, select Add Filemaker Data Source and use the open file dialog that appears to find and open the second file. Now you'll get a list of scripts from this second file and you select your script from this list.
The script you've posted can be made to work, but you have to first create a table occurrence in your current file that references the table in your second file and then create a layout based on that table occurrence.
Got it to work, Thanks for all your help!