Page 1 of 2

Retrieve focused folder from breadcrumb bar?

Posted: 14 Dec 2020 01:11
by jupe
Since the new CEA middle click on folder now applies to the breadcrumb bar too when applied, can anyone think of a way of retrieving the focused/hovered folder?

Re: Retrieve focused folder from breadcrumb bar?

Posted: 14 Dec 2020 01:24
by highend
If Don doesn't add any awareness to XY for it (by enhancing controlatpos() to return e.g. "BC 1|<hovered path> (<current path> if there is no hover)" or something like this, nope, not possible.

Re: Retrieve focused folder from breadcrumb bar?

Posted: 14 Dec 2020 01:28
by jupe
Yeah that's the conclusion I came too as well, currently my feeling is that unless something like your suggestion gets added, it should maybe be considered to disable it for the breadcrumb bar, because it is a hindrance as it is currently.

Re: Retrieve focused folder from breadcrumb bar?

Posted: 14 Dec 2020 19:07
by admin
Next version there will be <CEA_ClickedItem>.

Re: Retrieve focused folder from breadcrumb bar?

Posted: 14 Dec 2020 20:56
by LittleBiG
In my point of you, all variables which give back a folder name, should be ended with trailing slash. In this way, you could easily decide if you work with a folder or a file without extension.
What is the general rule now related to the trailing slash? (it came up when I changed my middle click script <curitem> to <CEA_ClickedItem> and it took a while to make it work again)

Edit: ah. <CEA_ClickedItem> on breadcrumb is trail-slashed, on a folder in the list it isn't.

Re: Retrieve focused folder from breadcrumb bar?

Posted: 15 Dec 2020 09:27
by admin
Next beta:

Code: Select all

    * Custom Event Actions: <CEA_ClickedItem> now always returns the item 
      without trailing backslash, like all other XY native variables.
      And, the value is reset (to "") after the script is finished.

Re: Retrieve focused folder from breadcrumb bar?

Posted: 15 Dec 2020 09:47
by highend
Imho it would be absolutely cool if <CEA_ClickedItem> would be:

Either:
- Renamed to <CEA_ClickedItems>

and follows the rules of all other <...> variables so that by default all entries are separated by "|" but you can choose your own separator if necessary
via <CEA_ClickedItems <crlf>>
and additionally really gives back all folders with a trailing backslash.

Or:
- Split into two variables
<CEA_ClickedFiles> and <CEA_ClickedFolders>
Where <CEA_ClickedFolders> is returned without trailing backslashes

Ofc with the same flexibility regarding the selection of your own separator like in "Either:"


This takes the burden off the script that is working with them to find out for each item if it is a file or a folder and assume you've clicked on 2k selected files...

Re: Retrieve focused folder from breadcrumb bar?

Posted: 15 Dec 2020 10:14
by admin
Why plural? You can click only one item.

Re: Retrieve focused folder from breadcrumb bar?

Posted: 15 Dec 2020 10:26
by highend
You can click on selections (e.g. middle click or a <hold right mouse button for <x> milliseconds> -> Do not show the context menu but fire a cea)

This opens a plethora of possibilities for scripts to process items

Re: Retrieve focused folder from breadcrumb bar?

Posted: 15 Dec 2020 10:30
by admin
Okay, but can't you just retrieve the currently selected items by script?

Re: Retrieve focused folder from breadcrumb bar?

Posted: 15 Dec 2020 10:41
by highend
Sure but as I said, providing these items with trailing backslash (or even better: as two variables) the script can just iterate / process them in a more lightweight way because it doesn't need to use exists() for each of them to find out if it's a file or a folder.

Re: Retrieve focused folder from breadcrumb bar?

Posted: 15 Dec 2020 11:13
by admin
Ok, makes sense. But the separator is not choosable because here the variable value is prepared "long" before the variable is seen and resolved. So it will be a hard "|".

Re: Retrieve focused folder from breadcrumb bar?

Posted: 15 Dec 2020 11:13
by LittleBiG
highend wrote: ↑15 Dec 2020 10:41 Sure but as I said, providing these items with trailing backslash (or even better: as two variables) the script can just iterate / process them in a more lightweight way because it doesn't need to use exists() for each of them to find out if it's a file or a folder.
Or it could be also good to grab the problem even at its root, generally: when I get the path of the selected items, should be an option to add the trailing slash automatically to the folders. And it could help in another cases, not only this.

Re: Retrieve focused folder from breadcrumb bar?

Posted: 15 Dec 2020 11:15
by highend
So it will be a hard "|".
I can live with that :tup:

Re: Retrieve focused folder from breadcrumb bar?

Posted: 15 Dec 2020 11:19
by admin
LittleBiG wrote: ↑15 Dec 2020 11:13
highend wrote: ↑15 Dec 2020 10:41 Sure but as I said, providing these items with trailing backslash (or even better: as two variables) the script can just iterate / process them in a more lightweight way because it doesn't need to use exists() for each of them to find out if it's a file or a folder.
Or it could be also good to grab the problem even at its root, generally: when I get the path of the selected items, should be an option to add the trailing slash automatically to the folders. And it could help in another cases, not only this.
Well, this would destroy lots of scripts I guess. Or I would have to introduce new variables. Well, not now...