How can Autohotkey get the active tab's folder directory?

I am a old user of 3 tools

  • Directory Opus
  • Autohotkey
  • Listary

And this feature of Listary "Quick Switch" had successfully convinced me buying it and kept it for years.
However I want to have similiar experience in company PC which, of course, don't have admin access to install me Listary (I can use Dopus and autohotkey as Pack-and-go)

The dreamed feature I want to have now with AHK is to "while I click middle button on Save as/Open standard dialogue, it jumps to the active Dopus directory"
now I've spotted the rest, now the part of "Get the folder path of the active tab in Dopus" is the last blocking stone.

does anyone have any idea, pleaes?

Quick Switch

Are you tired of digging through a slew of open windows to work with files in a program? With Listary’s Quick Switch feature, just click Ctrl+G to instantly jump to the open folder of the file you’re working with.


BTW. there is a much bigger project achived such goal, called Quick Access Popup by [Jean Lalonde], if you don't want to wait you can go take a look. It's a little bit heavy in my perspective, especially when i have DOpus already.
I tried to dive into his code, but don't really have a clue yet. ;(

▷ Folders Popup - Switch between current folders demo

1 Like

If you want a really easy way, you could turn on Preferences / Display / Options / Lister title bar: Display full path and then have your AHK script just look at the window title.

You can also use DOpusRT.exe: Retrieving File and Folder Information.

Hi, Leo,
Thanks for the tips.
I was realy excited of the "Titlebar" approach, I thought it'll be just severl minute away to claim "done".
but then I found that in certain situations it's not that good, like:

In Chinese version of Windows, special folders like "Users" "Desktop" are displayed in native language, and it's not the really path (i.e. the program will fail visitiing as it it).
Is there a setting to change this displaying behavior so that it's always the absolute path, please?

You could do it using a script to set the window titles on folder change, but you could also make the AHK side call ParseDisplayName.

I'd be surprised if the File Open dialog doesn't work with those paths as-is, though. Most of the shell does.

Oh, I stand corrected.
Yes the open/save as dialogue DOES accept the string as it is.
I say "program failed" because I only tried on normal Explorer instance.
Thanks again!

1 Like

I unchecked Folders/Folder Display/Display localized folder names
Then it worked fine for me. I use the Dutch version of Dopus

Hi, Ennovy,
That is also a very solid tip.
thanks a lot!

Unfortunately, this ruins my taskbar DOpus icon with the full path instead of just the active folder name, and the lister bar is nicer without it as well :slight_smile:

and this isn't performant enough due involving file operations. I'm using this as a replacement of the AltTab Listary functionality, and it requires polling the file manager for the current path so that when you AltTab back to your original Dialog, you'd have the most updated path to paste there.
This works fine with Windows Explorer (it reads path properties of an AHK's ComObject), but with Directory Opus it introduces a noticeable activity bump (cursor+hourglass icon), requiring a less functional workaround.

Would you maybe add a more simple way to pass a simple (set of) string(s) to Autohotkey rather than having to create a new process and wait until it updates an xml file every time? Thanks!

There's another thread somewhere where I demonstrated that generating the XML with dopusrt.exe is extremely fast.

If something is slow in that process, it's not in our side and should be something whoever designed the other side can speed up.

If the mouse cursor is changing when running dopusrt.exe then that is also down to the thing running it, not our side of things.

Found the thread: How to get selected file fullpath without dopusrt.exe?