And what are you trying to do with this script? Do you even need a script?
The programs are in different files, mine is called RCE.fmp12, and the Appointment Program is in Appt.fmp12
In both programs there is a client table with ClientID, First Name and Last Name.
I tried to make a script importing records (updating the matching records) but it take too long every time I click on Client Button.
I'm thinking in two ways:
1) Assuming that I already import all record from RCE to Appt Client table, when pushing client button: search all clientID from "Appt Client table" (because it's going to be the way to registering new clients) and compare them with the ClientID from "RCE Client table" and then copy the records (3 fields) that doesn't exist on RCE.
2) From Appt program I can call the RCE Client Table and make a copy of the layout that I used to register a new client on RCE program and then add a button in that layout that copy in a variable the ClientID, and then go to "Appt Client Layout" and search for his ID, if it exist then it will open his record, if not, then it will save as a new record and after that, stay in that record.
I hope you understand me. If you have a different approach or idea that will be faster solution, I will appreciate that.
If you have exactly the same fields in your client table in both files:
Open manage | Database | relationships in one of these two fields. Find the Client table and double click it. Use Add FileMaker Data source in the drop down to select the Client Table from the other file.
Now both files use the same table for client data--no importing or scripting needed. You, in fact, have a table that can now be deleted from the file where you made this change as it will no longer be used.