Layout or Window?
WindowNames is a function that you can check for the presence of File2's window name to see if it is open.
DatabaseNames will list the file names of each database file that is open.
If you create a script in file2 that uses
You can perform this script from file1 to get the name of the current layout in file2.