Two things you can do to reduce flashing. First use the Freeze window script step. Second when you open the new windows set the distance from top to be -10000 pixels. This will put the new window off screen so the user doesn't see it or a flash when it appears and is closed.
When you do this you may want to add a couple of scripts for use as a developer. The first is a close window script. Single script step, close window. Use this if you abort the script and have the window off screen. Next is a move window which moves the window to Distance from top of 10, so you can see what is going on.
Last thing I do for some of the this is create a pair of scripts that create and clear a global variable $$DEBUG. When created is gets a value of 1. I use this in the New window script step. I put the formula if($$DEBUG; 10; -10000) into the Distance from top field. So when I am debugging I can see the window and when the user is running the script it is off screen.
You don't mention which version of FM you are using. Screen Flashing is/was a bigger issue in versions 11 and earlier. Thats where I started with these techniques. Version 12 improved the screen flash issue quite a bit.
Create a custom function which evaluates as -10000 if the user is not full access. If they are full access have 0 or blank. Use this as the x and y in the distance from window box.
That way when you debug you can see the windows but the users can not.
Also bear in mind the various SQL plugins allow you to perform actions with complete disregard of the current context.
Thanks Bruce. FM12. And the flashing isn't bad, but when there are 10's of detail lines, it is noticeable. Mostly, I was just hoping I was ignorant and there is a better way. Opening the windows off screen makes sense. I should have thought of that. I do have a debug global variable and will do as you suggest for window placement -- good idea.
Popping off-screen utility windows is fine for hiding flashing from desktop users. Be careful about moving windows around if this is a script you anticipate wanting to run server-side, where window moving and resizing is not supported.
If performance ever becomes a problem, consider switching to a transactional processing method instead of switching layouts or opening new windows. Switching layouts and opening windows are relatively slow operations. You can select and manipulate related records by setting global key fields in the TO of the layout used in utility relationships to other TOs. You don't need any fields from these utility TOs to be on the layout.