Opening the file will trip the trigger and run the script, but maybe the file is already open and hidden at the time you click the button? there are a number of reasons why a file might be open in the background and closing it might not work as a reference in the first file might automatically re-open it in the background.
A more reliable method, and one that can allow you to open File B without tripping the trigger should you need to--say to do some development work on the file, is to just set the script in File A to Perform the script in File B. No need to trip any script triggers to get this to happen then. This requires the same External Data Source Reference used by Open File so you should be able to just select File B then select the script in File B when setting up that Perform Script script step.
I see the logic you are using, and you may very well be correct, Database B may very well be open in the background and hidden due to the fact that Database A has a field that does a look up into Database B.
So the script in Database A, would that simply consist of the following line ?:
Perform Script ["import" from file: "Database B"]
Or would I have to add lines that Open and then close Database B in the script ?
Here is an example of what is not working -
Filemaker Pro completely shut down, I open Database A but do not go to the layout with the field that does a lookup from Database B, (so I expect it will not open DB B in in the background).
I then open Database B, it runs the import script as expected.
I close DB B, and then go to DB A and go to the layout that has the field which does the lookup from DB B, and I run the script listed above, and DB B opens but DOES NOT run the import script!
I am assuming this is because even though I closed DB B, it was still left open somewhere in a hidden state and therefore not triggering the open script ??
Sidenote. is there any way to know or show a database that is opened but not showing in the list of opened Databases under the "Windows" Menu ?
You just need that one perform script step.
I close DB B, and then go to DB A and go to the layout that has the field which does the lookup from DB B,
My guess is that this reopened DB B in the background and thus your Open File Script failed to work the way you wanted it to.
I make it a practice to avoid, in nearly all cases, relying on one script tripping a script trigger to get something done. It's simpler and much safer just to perform the script in question. I add extra scripting to my scripts precisely to avoid such things as they result in brittle scripts where simply changing a layout--possibly months after setting the script up in the first place, breaks a script and you only find out that it failed when you spot incorrect results in your database due to the script failing.
One rather possibly important piece of information that may or may not effect this is ,, both databases are hosted with Filemaker Server,, I suspect that is not the cause of any problem I hope ?
Not that I can see from here, but my "view" is quite limited.