Script Steals Focus

Is it possible to prevent script to steal focus whilst running and displaying subsequent progress bars? Maybe with some modifier?

What kind of script? Or are we talking internal commands?

The script I published recently:

From a quick look at the script, it looks like the progress dialogs will come from the Command object running internal commands.

You could suppress those entirely if you wish: cmd.SetModifier("@noprogress") should do that, I believe.

But then you wouldn't get any progress at all, unless the script explicitly provides its own progress UI (e.g. using the [Progress](https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Scripting/Progress.htm(https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Scripting/Progress.htm) object).

If the problem is that you're seeing lots of consecutive progress dialogs appear during the operation, each one taking focus, then suppressing them and replacing them with a single progress dialog from the script should solve that. The only drawback (other than complexity) is you would not be able to report the progress as granularity, since the script isn't involved at a byte-by-byte or file-by-file level and has no way to update the progress dialog between commands.

You could alternatively turn on:

  • Preferences / File Operations / Progress Indicators:
    • Minimize progress indicators
    • And, optionally, Display the jobs bar automatically when starting a new job

That would stop all progress dialogs taking focus, as they would open in the background or not open at all, with progress displayed on either the jobs bar or the taskbar (depending on the second option).

1 Like

Thanks for the advice. To be frank I have thought about suppressing all dialog boxes and replace them with more intuitive single progress bar. I guess it should be no problem at all once I pre-count the files in focus.

If there would be some temporary script modifier, then it would be easier calling it a lazy solution. :slight_smile: