Page 1 of 1

Toggle File Extensions from Toolbar

Posted: 14 Jun 2021 18:36
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.

Re: Toggle File Extensions from Toolbar

Posted: 14 Jun 2021 18:51
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);

Re: Toggle File Extensions from Toolbar

Posted: 14 Jun 2021 19:05
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.

Re: Toggle File Extensions from Toolbar

Posted: 14 Jun 2021 19:28
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.

Re: Toggle File Extensions from Toolbar

Posted: 14 Jun 2021 19:59
by highend
Execute this from the address bar and show the complete output of it:
text columnlayout(, "get");

Re: Toggle File Extensions from Toolbar

Posted: 14 Jun 2021 20:37
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

Re: Toggle File Extensions from Toolbar

Posted: 14 Jun 2021 21:38
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 732 times

Re: Toggle File Extensions from Toolbar

Posted: 14 Jun 2021 22:00
by ovalseven
This is what I've got.

Re: Toggle File Extensions from Toolbar

Posted: 14 Jun 2021 22:44
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...

Re: Toggle File Extensions from Toolbar

Posted: 14 Jun 2021 22:53
by ovalseven
The contents in the file change each time but the button still has no affect on the file extensions.

Re: Toggle File Extensions from Toolbar

Posted: 15 Jun 2021 03:01
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;

Re: Toggle File Extensions from Toolbar

Posted: 15 Jun 2021 03:40
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.