I have a script On File First Open for a file, how can I suppress this script if I require when opening . the file as a new window.
You can't suppress the execution of the OnFirstWindowOpen script, but you can add an exit condition at the beginning. If I understand you correctly, you want to skip the opening script when the file is opened from another file? If so, you could try using a condition including the function DatabaseNames (crudely: if the name of the other solution is present in the result of that function, exit the script).
For better suggestions, it would be nice to have more details including an idea of why you want to suppress the execution of the OnFirstWindowOpen in some cases.
If you have [Full Access] and FMPA, start Script Debugger, launch the file and stop the script.
I haven't actually tried this technique, mainly just thinking out loud. I'll let you experiment with it to see if it'll do the job.
Have a global field called "Window Open". Initialize it to "1" at the end of your "OnFirstWindowOpen" script. Higher up in that script, test to see if it's already "1", and if so don't do whatever it is you're trying to avoid.
Create an "OnLastWindowClose" script to reset "Window Open" to "0", so it's ready for the next session.
Retrieving data ...