I doubt that you can.
When the script is run, is the resulting found set different from what was current before you ran it or does the found set change to accomplish some task and then change back to the original found set when done?
If so, there's a way to avoid scrolling the window for that specific case.
the found set is not the same as before. Only the record that was active before is also available in the new found set and is active. And that's so irritating, suddenly it is in a different line. (I assume you would have suggested creating a new window and then closing it again :-)
Is there no way to find out the current scrolling position or the position of the current line in the window or anything like that? Maybe the screen coordinates of the mouse pointer?
(I assume you would have suggested creating a new window and then closing it again :-)
Actually, that method doesn't always work well in windows systems. I use a layout based on a different table occurrence of the same table to keep finds from affecting the current layout's found set. That avoids the need to mess around with a hidden window.
Sorry, but I don't know of a way to do what you want.
Depending on the changes made to your found set, it might not be possible even if you could detect the scroll position of the current record. There might not be enough records present between the current record and the start of the found set to keep the same position. Obviously, that might not be the case with your specific design and it'd be nice to be able to do this both with layouts and also portals, but I have yet to discover a way to do that.
You are welcome to make a feature request in the Feature Suggestion Form.
It'll feel a bit like writing a suggestion on a piece of paper and dropping it down a well, but it's the best I can offer you as this is the means FileMaker has set up for collecting and reviewing customer based feature requests.