Custom Event Action for changing columns

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
hermhart
Posts: 248
Joined: 13 Jan 2015 18:41

Custom Event Action for changing columns

Post by hermhart »

I'm hoping someone can help me figure this out. I am trying to get the Status column to only appear when I browse a directory where the <curpath> contains "OneDrive" somewhere in it. I have tried the following code in all three of the Custom Event Action - Changing Locations Events separately, but it seems that no matter what way I try, it either doesn't work at all, or the Status column shows up all the time. Any thoughts on how to only get this to show with "OneDrive" in the <curpath>?

Code: Select all

 $path = <curpath>;
 if ($path like "*OneDrive*") {
    // Adjust the comma-separated list to match your preferred columns (including Status)
    setcolumns("Name,Size,Modified,Status");
 } else {
    // Standard layout without Status
    setcolumns("Name,Size,Modified");
 }
Windows 11 Pro; 100% scaling

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

Re: Custom Event Action for changing columns

Post by highend »

if (<newpath> Like "*OneDrive*") {
One of my scripts helped you out? Please donate via Paypal

hermhart
Posts: 248
Joined: 13 Jan 2015 18:41

Re: Custom Event Action for changing columns

Post by hermhart »

Thanks highend, that worked!
Windows 11 Pro; 100% scaling

Post Reply