File operation dialog does not display

It seems that the file operation dialog was no longer displayed during the beta version, I only noticed it now because I wanted to cancel the copy. I looked at the settings and it doesn't seem to be relevant.
If I exit Opus, the file operation dialog will be visible.
Opus 13.1

Are you using Active Window Manager or anything like that which moves/resizes/on-tops other program's dialogs?

If so, try uninstalling it. Many of those tools cause problems with our progress dialogs for some reason.

I only have Listary and some AutoHotkey scripts that just inspect the windows and won't operate on Opus.
If I uncheck the script that uses WatchTab, the file operation dialog comes back. The problem seems to come from Opus.

// EventUpdateVar-ADS
// (c) 2022 Ken

// This is a script for Directory Opus.
// See https://www.gpsoft.com.au/DScripts/redirect.asp?page=scripts for development information.



// Called by Directory Opus to initialize the script
function OnInit(initData)
{
	initData.name = "EventUpdateVar-ADS";
	initData.version = "1.1.5(23.11.14)";
	initData.copyright = "(c) 2022 Ken";
	initData.url = "https://resource.dopus.com/t/set-tags-add-tags-by-list-beta/43269/2";
	initData.desc = "Display ADS in the Status Bar. \r\nFor Preferences / Display / Status Bar: ADS={var:lst:ADS}";
	initData.default_enable = true;
	initData.min_version = "12.0";
}

function OnAddCommands(addCmdData)
{
    var cmd = addCmdData.AddCommand();
    cmd.name = "UpdateVarADS";
    cmd.method = "OnUpdateVarADS";
    cmd.desc = "EventUpdateVar-ADS";
    cmd.label = "UpdateVarADS";
    cmd.template = "";
    cmd.hide = false;
    cmd.icon = 'script';
}

function OnUpdateVarADS(scriptCmdData)
{
    var tab = scriptCmdData.func.sourcetab;
	//var lister = tab.lister;
	var lister = DOpus.Listers(0);
	if (!tab || lister.Vars.Exists("UpdateVarADS")) return
	lister.Vars.Set("UpdateVarADS") = 1;
	var dlg = scriptCmdData.func.Dlg();
    var cmd = scriptCmdData.func.command;
	
	dlg.detach = true;
	dlg.template = "dialog1";
    dlg.title = "OnSelect";
	dlg.top = false;
    dlg.create();
    //dlg.show();
	dlg.opacity = 0;   // Make the dialog invisible
    dlg.watchtab(tab, "select,activate,srcdst");   // Watch events
    
	var msg;
	
	do
	{
		msg = dlg.GetMsg();
		
        var msgResult = msg.result;
	    if (!msgResult)
			break;
        
		var value = msg.value;
		/*
		var event = msg.event;
		var ctrl = msg.control;
		var dt = msg.data;
		DOpus.Output("Event: " + event + ", Value: " + value + " ctrl: " + ctrl + " data:" + dt);
        */
		if (value == "select")                                          // If there is a select event
		{
			tab.Update();
			if (tab.Selected.count > 0)
			{
			   var fsu = DOpus.fsutil;
			   var ADSfile = tab.Selected(0).realpath + ":Tags";        // ADSfile
			   // If ADSfile exists
			   if (fsu.Exists(ADSfile)) {
				   var ST = DOpus.Create.StringTools();
				   
				   var openText = fsu.OpenFile(ADSfile, "r");           // Read ADSfile
				   var text = openText.Read();
				   openText.Close;
				   
				   var textbom = ST.Decode(text, "utf-8 bom");          // Decode as UTF-8 with BOM
				   var myArray = textbom.split("\r\n");                 // The separator is \r\n
				   var ADS = myArray[0];                                // Get the first line
			   } else {var ADS = "";}
			   
			   lister.Vars.Set('ADS', ADS);
			}
			else
			{
			   lister.Vars.Set('ADS') = "";
			}
			cmd.UpdateToggle();                                         // Refresh
		} else if (value == "activate" || value == "srcdst") {
			lister.Update();
			var tab = lister.activetab;
			if (!tab) var tab = DOpus.listers.lastactive.activetab;
			try {
			    dlg.watchtab(tab, "select,activate,srcdst");
			} catch (error) {break}
		} else if (value == "close") {
			lister.Update();
			if (!lister.lastactive)
				break
		}
	}
	while (msg);   // msg loop
	if (lister.Vars) lister.Vars.Delete("UpdateVarADS");
}


var cmd = DOpus.Create().Command();


// Called when a tab is activated
function OnActivateTab(activateTabData)
{
	cmd.RunCommand('UpdateVarADS');
}

// Called when a Lister is activated
function OnActivateLister(activateListerData)
{
    cmd.RunCommand('UpdateVarADS');
}



==SCRIPT RESOURCES
<resources>
	<resource name="dialog1" type="dialog">
		<dialog fontsize="8" height="14" lang="english" opacity="0" width="54">
			<control close="0" height="14" name="button1" title="Exit" type="button" width="54" x="0" y="0" />
		</dialog>
	</resource>
</resources>

Ah, very strange. Thanks for those details!

It's possible the hidden WatchTab window is being chosen as the dialog parent, maybe. We'll investigate.

@Leo, Can I ask you a question in private?

@WKen does it make any difference if you change this line:
var dlg = scriptCmdData.func.Dlg();
for this one?
var dlg = DOpus.Dlg();

I see a similar behaviour with some dialogs who has a lister or a tab as a parent.

1 Like

I tested a long time ago that the var dlg = DOpus.Dlg();, script dialog was visible in the taskbar's thumbnails.
I tested according to your tip and the file operation dialog was displayed normally, but the taskbar still displayed the thumbnail of the script dialog.

1 Like