Scripting - cannot get a progress dialog to center over current lister

Cannot get a progress dialog to center over current lister.
Have tried passing the function clickData instead of using DOpus , but same result, the progress dialog always appears bottom left of monitor - see SS below.
Here is the progress dialog code.

			if (progress_dialog)
			{
				var lister 		= DOpus.listers.lastactive;
				var progress	= cmd.Progress;
				var counter		= 0;
				progress.abort	= false;
				progress.bytes	= false;
				progress.delay	= false;
				progress.full	= false;
				progress.owned	= true;
				progress.pause	= false;
				progress.skip 	= false;

				progress.Init(lister, 'PLEASE WAIT - BUILDING LIST OF IMAGES');
				progress.SetFiles(vector_of_collection.count);
				progress.Show();
			}

Using scriptCmdData.func.sourcetab as the first parameter to Init seems to work for me (lister centered).

(Merged from duplicate thread. --Leo)


Seems this might be a bug, all progress dialogs seem affected, doing a long copy and the dialog is appearing bottom-left of monitor, instead of centered on current lister.

Instead of opening a new thread, have you tried my suggestion?
Just tried again with 13.23.1 and these work for me:

  • scriptCmdData.func.sourcetab : centers in the tab pane
  • scriptCmdData.func.sourcetab.lister : centers in the lister of the tab

More globally:

	var fsutil = DOpus.FSUtil;
	var cmdProg = DOpus.Create.Command();
	var progress = cmdProg.progress;
	var progressIndex = 0;
	var progressTotal = 0;

	// progress.Init(scriptCmdData.func.sourcetab, "Smart Extract");
	progress.Init(scriptCmdData.func.sourcetab.lister, "Smart Extract");
	progress.pause = false;
	progress.SetTitle("Smart Extract");
	progress.Show();

Yes, tried, got error on scriptCmdData, looked it up - no such thing, but tried scriptCommandData and still error because I am not using that entrypoint in this script, using OnClick.

and if its working on your system why are normal DO copy progress dialogs on my system not centered over lister and positioning in same position as my script progress dialogs. Looks like bug to me.

Have you turned on Preferences / File Operations / Progress Indicators / Remember previous position? If so, turn it off if you want progress dialogs to center on windows.

I see. If you're in a script button, the entry point is indeed OnClick (instead of the one you could have used in a script add-in, which gives a ScriptCommandData object as a parameter, by default named scriptCmdData if you use the script creation dialog to initialize your script and give the command names you want).
In that case, the OnClick should use a parameter named clickData (a ClickData object, which also has a func property).
You can then use:

  • clickData.func.sourcetab : to center in the tab pane active when you click your button
  • clickData.func.sourcetab.lister : to center in the lister of the tab active when you click your button

But first, you need to check the setting provided by Leo which is most likely what prevents you from having the dialog where you want.

Awesome, many thanks to both of you

fixed, by turning this off.