How to show a user message that automatically disappears?

What is the best way to show a non-modal message to the user in a way that he can continue working and the message will automatically disappear (after a defineable timeout)? For example sometimes a drive ejection took many seconds and it would be nice to have a reliable non-modal message informing the user about the result (success or not).

PS: I haven't found any way to show a balloon tip by using a DOpus command / modifier?

1 Like

You probably want the Progress if we're talking about scripting.

There isn't a way (that's built into Opus) outside of scripting.

I've hoped that we could inject a new command to DOpus but unfortunately there seems to be no method call to display a balloon tooltip from JScript.

After several occasions in which I needed a small tool for showing balloon-tips, I finally have written one myself. It has proved to be very useful to use in several DOpus scripts here.

You can get the tool and the source here ...

ShowBalloonTip.zip (218 KB)
The following call produces the shown balloon, that automatically disappears after 4 seconds:

Type 1 -> Info
Type 2 -> Warning
Type 3 -> Error

ShowBalloonTip 1 4 "Hardware Removal Success (I:)" "The device that was connected to drive I: was successfully dismounted."


Good work mythos! o) What is wrong with available tools doing the same?

Anyway, the balloons are quite handy for specific situations if not over-used.
Thanks for bringing them back into memory, I actually never thought of showing a balloon from a DO script or button, but nice idea! o)

To be honest I wanted a generic icon (because each balloon tip must belong to a systray icon). Thus I chose this bubble icon and compiled a little AHK script. Finally I bound a JScript to all CTRL+SHIFT+ALT+<A..Z> key combos that automatically ejects any cdrom and dismounts any other drive. It's quite useful to simply removing any hardware device by just pressing a hotkey (refering to the drive letter). I use that many many times per day.

@script jscript

function removeDrive(driveletter, command) {
	var wsh = new ActiveXObject("WScript.Shell");
	var fso = new ActiveXObject("Scripting.FileSystemObject");
	if (fso.DriveExists(driveletter + ":")) {
		var dopusdatapath = DOpus.aliases("dopusdata").path;
		if (fso.getDrive(driveletter + ":").DriveType == 4) {
			// cdrom
			var result = wsh.Run("\"" + dopusdatapath + "\\Scripts\\EjectMedia.exe\" " + driveletter + ":", 0, true);
			if (result == 0) {
				command.RunCommand("\"/dopusdata\\Scripts\\ShowBalloonTip.exe\" 1 6 \"Media Eject Success (" + driveletter + ":)\" \"The media in drive " + driveletter + ": was successfully ejected.\"");
				command.RunCommand("Play \"/dopusdata\\Sounds\\info.wav\" QUIET");
			} else {
				command.RunCommand("\"/dopusdata\\Scripts\\ShowBalloonTip.exe\" 3 6 \"Media Eject Error (" + driveletter + ":)\" \"The media in drive " + driveletter + ": could not be ejected (device probably in use by another application).\"");
				command.RunCommand("Play \"/dopusdata\\Sounds\\error.wav\" QUIET");
			}
		} else {
			// other
			var result = wsh.Run("\"" + dopusdatapath + "\\Scripts\\RemoveDrive.exe\" " + driveletter + ":", 0, true);
			if (result == 0) {
				command.RunCommand("\"/dopusdata\\Scripts\\ShowBalloonTip.exe\" 1 6 \"Hardware Removal Success (" + driveletter + ":)\" \"The device that was connected to drive " + driveletter + ": was successfully dismounted.\"");
				command.RunCommand("Play \"/dopusdata\\Sounds\\info.wav\" QUIET");
			} else {
				command.RunCommand("\"/dopusdata\\Scripts\\ShowBalloonTip.exe\" 3 6 \"Hardware Removal Error (" + driveletter + ":)\" \"The device that is connected to drive " + driveletter + ": could not be dismounted (device probably in use by another application).\"");
				command.RunCommand("Play \"/dopusdata\\Sounds\\error.wav\" QUIET");
			}
		}
	} else {
		command.RunCommand("\"/dopusdata\\Scripts\\ShowBalloonTip.exe\" 2 6 \"Drive Access Error (" + driveletter + ":)\" \"The specified drive " + driveletter + ": can not be accessed or does not exist.\"");
		command.RunCommand("Play \"/dopusdata\\Sounds\\warn.wav\" QUIET");
	}
}

function OnClick(clickData) {
	removeDrive("D", clickData.func.command);
}

BTW: The script given above refers to the well known drive tools from Uwe Sieber.

uwe-sieber.de/drivetools_e.html