how to copy folder path without final backslash by "Ctrl+P"

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
lambda
Posts: 18
Joined: 12 Mar 2020 02:45

how to copy folder path without final backslash by "Ctrl+P"

Post by lambda »

As the title,how to copy folder path without final backslash by "Ctrl+P"?
I set keyshorcut for copy "Item UNC Path",but There are backslashes at the end of the copyed path, What i needs to be configured?
Thanks your help very much!

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

Re: how to copy folder path without final backslash by "Ctrl+P"

Post by admin »

You mean when the focus is in the folder tree? That's currently not possible.

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

Re: how to copy folder path without final backslash by "Ctrl+P"

Post by highend »

Unassign CTRL+p, create a user defined command, use this script and assign CTRL+p to it...

Code: Select all

    if (<get FocusedControl> != "T") {
        if (<get CountSelected> > 0) { copytext <get SelectedItemsPathNames <crlf>>; }
        else { copytext <curpath>; }
    } else {
        copytext <curpath>;
    }
One of my scripts helped you out? Please donate via Paypal

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

Re: how to copy folder path without final backslash by "Ctrl+P"

Post by admin »

OTOH, AFAIK all paths in XY variables and other copy command (e.g. View | Tab | Copy Location Term) are returned without slash. This case here (Ctrl+P) in Tree seems to be the only exception. Shouldn't I just make it consistent and remove the slash here as well?

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

Re: how to copy folder path without final backslash by "Ctrl+P"

Post by highend »

Then you should add something like
Configuration | General | Controls & More | Miscellaneous | Tree paths include trailing backslash

for those who are used to / depend on the old setting...
One of my scripts helped you out? Please donate via Paypal

Filehero
Posts: 2734
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: how to copy folder path without final backslash by "Ctrl+P"

Post by Filehero »

No. :)

This is a daily timesaver for me (within the "Save as ..." dialog of all programs I use)

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

Re: how to copy folder path without final backslash by "Ctrl+P"

Post by admin »

Well, I try to avoid an additional setting. I think it would okay and logical to bind it to this setting:
Configuration | General | Controls & More | Miscellaneous | Address Bar paths include trailing backslash

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

Re: how to copy folder path without final backslash by "Ctrl+P"

Post by admin »

I just saw that even the command "Copy Path" in "Configuration | General | Menus, Mouse, Usability | Context Menus | Folder Tree..." copies without slash although the context menu shows the Ctrl+P keyboard shortcut. So one could argue the current behavior of Copy Path is a bug. :bug:

Filehero
Posts: 2734
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: how to copy folder path without final backslash by "Ctrl+P"

Post by Filehero »

admin wrote: ↑04 Oct 2020 17:10 Well, I try to avoid an additional setting. I think it would okay and logical to bind it to this setting:
Configuration | General | Controls & More | Miscellaneous | Address Bar paths include trailing backslash
Since it works this way in the list too, why not an even more generalization like File item paths ...

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

Re: how to copy folder path without final backslash by "Ctrl+P"

Post by admin »

Filehero wrote: ↑04 Oct 2020 17:09 No. :)

This is a daily timesaver for me (within the "Save as ..." dialog of all programs I use)
They don't work without the slash?

Filehero
Posts: 2734
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: how to copy folder path without final backslash by "Ctrl+P"

Post by Filehero »

admin wrote: ↑04 Oct 2020 17:14 They don't work without the slash?
I just copy the path of an selected folder (with backslash) and paste it in front of the file name -> no target folder navigation needed at all.

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

Re: how to copy folder path without final backslash by "Ctrl+P"

Post by admin »

Filehero wrote: ↑04 Oct 2020 17:14
admin wrote: ↑04 Oct 2020 17:10 Well, I try to avoid an additional setting. I think it would okay and logical to bind it to this setting:
Configuration | General | Controls & More | Miscellaneous | Address Bar paths include trailing backslash
Since it works this way in the list too, why not an even more generalization like File item paths ...
Yes, maybe. Not sure about all the ramifications... :eh:

What is your setting of Address Bar paths include trailing backslash?

Filehero
Posts: 2734
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: how to copy folder path without final backslash by "Ctrl+P"

Post by Filehero »

I'm on iOS right now - an OS that still tries to avoid to bother a user with simple things like files. At least, a keyboard simulation is there ...

Later when back at home.

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

Re: how to copy folder path without final backslash by "Ctrl+P"

Post by admin »

Seeing this I'd say the current behavior is a bug:

Code: Select all

v19.50.0244 - 2019-01-26 14:52
...
     * Copying paths to clipboard: Now paths are copied without a trailing 
       backslash. Before, it was not always like that.
       Exception: According to some crazy de facto standard (Windows Explorer 
       does it like this) drive roots are returned with backslash ("C:\", not 
       "C:").
But I guess I will have to add a setting like "Copy paths to clipboard with a trailing slash"...

Filehero
Posts: 2734
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: how to copy folder path without final backslash by "Ctrl+P"

Post by Filehero »

:tup:

Post Reply