Retrieve focused folder from breadcrumb bar?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
LittleBiG
Posts: 1848
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Retrieve focused folder from breadcrumb bar?

Post by LittleBiG »

admin wrote: ↑15 Dec 2020 11:19
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...
I don't think so... "SelectedItemsPathNamesSlashed" into the get command. Then, by two formatlist commands we could separate files and folders into their respective variables, instead of using exists() on each. I am not sure how this could destroy anything.
Am I wrong when I think 2 formatlist is quicker on many items than exists for each?

Edit: also, is it logical to create those variables to separate files and folders here in middle-click only, but not on the other places as well? Nevermind. I just think a general solution is always better then one which can solve only one problem. Harder to remember.

admin
Site Admin
Posts: 67270
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Retrieve focused folder from breadcrumb bar?

Post by admin »

Okay. :)

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Retrieve focused folder from breadcrumb bar?

Post by highend »

Thanks, all those new variables work fine in initial testing.

Imho you should add "SelectedItemsNamesSlashed" for consistency as well :party:
One of my scripts helped you out? Please donate via Paypal

LittleBiG
Posts: 1848
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Retrieve focused folder from breadcrumb bar?

Post by LittleBiG »

admin wrote: ↑15 Dec 2020 12:40Okay. :)
Thanks!!

Code: Select all

//test the slashed
  $selected = get("selecteditemspathnamesslashed");
  $folders = formatlist($selected,"f","<crlf>","*\");
  $files = formatlist($selected,"f","<crlf>","!*\");
  text "Folders:<crlf>$folders<crlf><crlf>Files:<crlf>$files";
Sooo easy! :appl:

Post Reply