AnsweredAssumed Answered

Closing All Windows for a Specific File

Question asked by MSNThomas on Jun 20, 2016
Latest reply on Jun 20, 2016 by user19752



I've a developer who works in several different systems a day for different customers, and created a launcher file that uses fmp protocol to open various files on various servers without using an external file reference to them.


I'm trying to write  a script that will also close all windows for a given file. 


My first thought was to loop through the windows and use Get ( filename ) to close all windows where Get ( filename ) = $FileName ( and I've already set $FileName to the name of the the file I want to close ). 


However, Get ( filename ) will get the name of the file running the script, not the name of the file of the window selected.


Does anyone know a way to get the filename of a window when the window is from a different file than the one running the script ?


Also, oddly enough, get WindowNames will give me the names of all the windows that are open, but using WindowNames ( "filename" ) with the name of the file I'm trying to close will NOT give me the names of the windows association with that file.  That only works if "filename" is the name of the file you are currently in/ running the script from.