Toggle File Extensions from Toolbar

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
ovalseven
Posts: 16
Joined: 14 Jun 2021 18:22

Toggle File Extensions from Toolbar

Post by ovalseven »

I'm new to XYplorer and would like to set this up similar to my OpenShell layout. All I'm missing is a toolbar button to enable/disable displaying file extensions. I can't find a button for that. I see an option for custom buttons but I don't know how to set that up.

highend
Posts: 10571
Joined: 06 Feb 2011 00:33

Re: Toggle File Extensions from Toolbar

Post by highend »

Add a "User Button #..." to the toolbar and use this script

Code: Select all

$layoutFile = "<xydata>\Columns\Toggle extension column.txt";
    $layoutText = columnlayout(, "get");

    // No ext column
    if (!regexmatches($layoutText, "(^|,)\+Ext\.")) {
        $layoutText = regexreplace($layoutText, "Ext\.", "+Ext.", 1)
    // Ext column
    } else {
        $layoutText = regexreplace($layoutText, "\+Ext\.", "Ext.", 1)
    }
    writefile($layoutFile, $layoutText, , "utf8");
    columnlayout($layoutFile);
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

Horst
Posts: 297
Joined: 24 Jan 2021 12:27
Location: Germany

Re: Toggle File Extensions from Toolbar

Post by Horst »

And why do you want to hide extensions ?
From the security aspect this should never be hidden.
It was a very bad design idea from Microsoft to have such an option in Explorer.
Windows 10 Home x64 Version 21H2 (OS Build 19044.1110)
Portable XYplorer v22.10.0013
Everything 1.5.0.1270a (x64)

ovalseven
Posts: 16
Joined: 14 Jun 2021 18:22

Re: Toggle File Extensions from Toolbar

Post by ovalseven »

highend wrote: 14 Jun 2021 18:51 Add a "User Button #..." to the toolbar and use this script
I pasted that into the script box, but nothing happens when I click the user button.

highend
Posts: 10571
Joined: 06 Feb 2011 00:33

Re: Toggle File Extensions from Toolbar

Post by highend »

Execute this from the address bar and show the complete output of it:
text columnlayout(, "get");
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

ovalseven
Posts: 16
Joined: 14 Jun 2021 18:22

Re: Toggle File Extensions from Toolbar

Post by ovalseven »

Code: Select all

Index.56,Path.150,+Name.300,+Ext.43,+Size.62,+Type.120,+Modified.115,+Created.115,Accessed.115,Attr.80,Len.47,Label.56,Tags.53,Comment.82,Extra 1.64,Extra 2.64,Extra 3.64,Extra 4.64,Extra 5.64,Custom 1.79,Custom 2.79,Custom 3.79,Custom 4.79,Custom 5.79,Extra 6.64,Extra 7.64,Extra 8.64,Extra 9.64,Extra 10.64,Extra 11.64,Extra 12.64,Extra 13.64,Extra 14.64,Extra 15.64,Extra 16.64

highend
Posts: 10571
Joined: 06 Feb 2011 00:33

Re: Toggle File Extensions from Toolbar

Post by highend »

On hitting the button it should hide your Ext column (in the state you're posted it) and that works fine in a test setup here...

So your button setup looks like this?
1.png
1.png (22.93 KiB) Viewed 198 times
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

ovalseven
Posts: 16
Joined: 14 Jun 2021 18:22

Re: Toggle File Extensions from Toolbar

Post by ovalseven »

This is what I've got.
Attachments
ss.png
ss.png (27.52 KiB) Viewed 196 times

highend
Posts: 10571
Joined: 06 Feb 2011 00:33

Re: Toggle File Extensions from Toolbar

Post by highend »

Execute the button once,

Menu - Go - Go to Application Data Folder
Navigate into the "Columns" subfolder, open the "Toggle extension column.txt" with a text editor, show the content.

Close that file, press the button again, open the file, show the content a second time...
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

ovalseven
Posts: 16
Joined: 14 Jun 2021 18:22

Re: Toggle File Extensions from Toolbar

Post by ovalseven »

The contents in the file change each time but the button still has no affect on the file extensions.

jupe
Posts: 1554
Joined: 20 Oct 2017 21:14
Location: 21H1 x64 @120dpi

Re: Toggle File Extensions from Toolbar

Post by jupe »

If you just want to toggle showing the file extension from the end of the filename, NOT toggle the actual Ext column all you would need in the on left click field of the custom toolbar button is this by itself: #412;

ovalseven
Posts: 16
Joined: 14 Jun 2021 18:22

Re: Toggle File Extensions from Toolbar

Post by ovalseven »

jupe wrote: 15 Jun 2021 03:01 If you just want to toggle showing the file extension from the end of the filename, NOT toggle the actual Ext column all you would need in the on left click field of the custom toolbar button is this by itself: #412;
This does what I was trying to accomplish. Thank you.

Sorry if my initial question wasn't clear.

Post Reply