Automatically respond to error dialogs

I want to map drives on access, I got this partially working by detecting the windows auth popup using OnMessage in Autohotkey, but...

In some conditions there is no auth prompt, dopus says "An error occurred reading folder: The system cannot find the path specified. (3)" which shows in WindowSpy as

Directory Opus
ahk_class #32770
ahk_exe dopus.exe

But my onMessage does not detect it.

Looking for another way to detect this error...
image

If AHK's OnMessage only detects Message Boxes then it won't work as the error message is generic dialog box.

You might be able to do what you're aiming for using the OnBeforeFolderChange scripting event in Opus. I'm not sure if it'll work with paths that don't exist yet, but it's worth a try.

Or, if you're accessing the non-existent drives via toolbar buttons (or menu items or hotkeys), those could map the drives before changing to them.

The most important thing to me is getting rid of the 2x error dialogs which require a response when a drive letter is not available. How can these be removed?

Is there no way to do this? To just show "drive unavailable" in the file listing, or even just blank?

You might be able to do what you're aiming for using the OnBeforeFolderChange scripting event in Opus. I'm not sure if it'll work with paths that don't exist yet, but it's worth a try.

Or, if you're accessing the non-existent drives via toolbar buttons (or menu items or hotkeys), those could map the drives before changing to them.