Getting the panes current paths from/to an AHK script?

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

autocart
New Member
Posts: 3
Joined: 2013 Oct 24, 11:35

Getting the panes current paths from/to an AHK script?

Post by autocart »

Hello all,

before one asks, I did find this thread: "autoit AHK and what have you" (viewtopic.php?p=72455#p72455)
but I thought I rather start a new one.

Question:
Is it possible to get the paths of both panes from/to an AutoHotkey script?
The script should initiate the request and then the paths should be returned to the script. If you want, you can call it "remote control" x2 to provide the data to the script.

As shown in the linked thread, it seems possible to a degree to get the current path of the address bar.
However, there are the following problems or open questions:
1) The shown examples in the cited thread are not very reliable. E.g. if the address bar has a different content than the current path, the result is not what I want. And it does not matter if it is ok in 99 % of cases. It should be 100 %.
2) It should also work in the background, without "activating" x2. Is this possible?
3) Regarding such automation in x2, how do I initiate it from outside? In other words: How can an AHK script tell x2 to silently and reliably provide the paths. Of course, this should work with an already running x2 instance.
4) How do I get the data back to the AHK script?
5) Is there a way to do all that also in the light version? (This would be a bonus, if it is pro only, so be it. But I am asking, just in case.)

Hope I did not forget anything. Thanks for any helpful answers.
Regards

EDIT, BTW: In case someone wonders, I am asking because of this: https://www.voidtools.com/forum/viewtop ... 881#p37077
User avatar
nikos
Site Admin
Site Admin
Posts: 16344
Joined: 2002 Feb 07, 15:57
Location: UK

Re: Getting the panes current paths from/to an AHK script?

Post by nikos »

if you search the forum for UWM_GETDIRECTORY you will see there is a roundabout way to get the current folder of the active pane. Nothing for the inactive pane. I will think about this for a future version probably using WM_COPYDATA for easy export

I am not sure what you're trying to do with "everything" but if you run it as an xplorer2 user command, it is very easy to get the folders you want with $L and $R

ps. Actually it may be possible to get the path using MSAA. Find the WTL_DNTabCtrl class (tab control) of each pane then use get_accSelection to find the current tab, then get_accName to get the path.

I think this should work even if the tab strip isn't visible
autocart
New Member
Posts: 3
Joined: 2013 Oct 24, 11:35

Re: Getting the panes current paths from/to an AHK script?

Post by autocart »

nikos wrote: 2022 Apr 15, 11:45 it may be possible to get the path using MSAA. Find the WTL_DNTabCtrl class (tab control) of each pane then use get_accSelection to find the current tab, then get_accName to get the path.

I think this should work even if the tab strip isn't visible
After a first initial quick research, this looks promising.
Will have to look into it more when I have more time.
So far, thank you very much, nikos!
Regards