get path of active pane/tab with macro

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1255
Joined: 2005 Oct 16, 19:09

get path of active pane/tab with macro

Post by FrizzleFry »

I have a macro that was getting the path of the active folder from the address bar but that code does not work with v6 probably because of the crumbs bar.

this is the code I was using:
# get name of active folder from address bar
findwnd address
findclass combobox
gettext $2
pop $2
chopstr \-1
addstr $1
store $2

is there another way to get the path of the active/current folder?
User avatar
nikos
Site Admin
Site Admin
Posts: 16344
Joined: 2002 Feb 07, 15:57
Location: UK

Re: get path of active pane/tab with macro

Post by nikos »

the easiest way would be to restore the old addressbar from advanced options
looks like the crumbsbar will go the same way as the ribbon!
Gandolf
Gold Member
Gold Member
Posts: 575
Joined: 2004 Jun 12, 10:47

Re: get path of active pane/tab with macro

Post by Gandolf »

nikos wrote: 2024 May 30, 06:06 ...looks like the crumbsbar will go the same way as the ribbon!


HOORAY!!! :D :D :D
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1255
Joined: 2005 Oct 16, 19:09

Re: get path of active pane/tab with macro

Post by FrizzleFry »

Disabling the crumbs bar and enabling the address bar does allow my macro to run successfully.
Gandolf
Gold Member
Gold Member
Posts: 575
Joined: 2004 Jun 12, 10:47

Re: get path of active pane/tab with macro

Post by Gandolf »

Instead of "findwnd address" have you tried "COMMAND 32859 # Switch to address bar". That appears to switch to the address bar AND switch it from crumbs to normal. The rest of your macro might work then.
Gandolf
Gold Member
Gold Member
Posts: 575
Joined: 2004 Jun 12, 10:47

Re: get path of active pane/tab with macro

Post by Gandolf »

Another way I discovered (in V6) was:

findwnd address # selects the Filter box
NEXTWND # steps to the address bar

which selects the address bar, but it's still in crumb mode.
User avatar
nikos
Site Admin
Site Admin
Posts: 16344
Joined: 2002 Feb 07, 15:57
Location: UK

Re: get path of active pane/tab with macro

Post by nikos »

you are turning into macro hacker :)
however the first version is more robust, because NEXTWND depends on the arrangement of the toolbars
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1255
Joined: 2005 Oct 16, 19:09

Re: get path of active pane/tab with macro

Post by FrizzleFry »

Gandolf wrote: 2024 Jun 03, 02:22 Instead of "findwnd address" have you tried "COMMAND 32859 # Switch to address bar". That appears to switch to the address bar AND switch it from crumbs to normal. The rest of your macro might work then.
Using command 32859 works with the crumbs bar enabled or disabled. Thanks.

Messing around with this macro reminded me how annoying is it to create and edit x2 macros. I usually end up copying and pasting to and from a text editor. The three line properties field available from organize is fine for one line macros and user commands but inadequate for complex macros (this macro is 50 lines long). Edit macro has more space but it is also annoying: you have to run the macro to make it active (I guess?), then you have to run the macro to save it.
Gandolf
Gold Member
Gold Member
Posts: 575
Joined: 2004 Jun 12, 10:47

Re: get path of active pane/tab with macro

Post by Gandolf »

I'm glad it works. I haven't done much with x² macros and, what I have done, has given me no incentive to learn more about them.

When I discovered that "findwnd address" actually focuses on the Filter bar if crumbs are active, I thought, not worth the effort. The command "findwnd CrumbBar" appears to focus on the crumbs bar, much to my surprise!
User avatar
nikos
Site Admin
Site Admin
Posts: 16344
Joined: 2002 Feb 07, 15:57
Location: UK

Re: get path of active pane/tab with macro

Post by nikos »

FrizzleFry wrote: 2024 Jun 03, 20:39Edit macro has more space but it is also annoying: you have to run the macro to make it active (I guess?), then you have to run the macro to save it.
a simple hack is to click DEBUG instead of running the macro, then you can cancel after the first command, AND save it