Open a New Window, constrain, do stuff, close window. Wash, rinse, loop.
Thanks erolst - is it more efficient, performance-wise, to do it this way (i.e. window manipulation better than repeated GTRRs?)
I guess that depends (as always) on the circumstances, ie the size of the found set, what is going on in the layout you came from, what exactly FM is caching ...
... but I would prefer the New Window method, especially if you do the initial GtRR to a dedicated layout that has no fields (which you don't need for a script without user interaction).
Here the impact from opening a new window should be much smaller than returning to a potentially busy original layout to have the correct context for another GtRR.
Now that you know two approaches, why not write two different scripts and compare their performance?
Thanks, as ever. I'll do just that, and report back.
to add a bit - yes, you only need the GTRR once. That found set is retained in the original window. From there, as described above, open a new window, use it, close it, loop.
Note: I sized this window to keep it off-screen. This prevents windows flashing on the screen. Also, my personal convention is to name the new window the same as the script name.