Button to toggle list sort

I wanted to create a button that makes folders files in a lister show in last modified date order. I came up with this.

Set COLUMNS SORTBY=modified

Now it does that, however I want it when I click it a second time to restore things to the order they were before. I think I would call this toggle on and off of a sort. Thanks

@If:Set SORTBY=Name
Set SORTBY=Modified
@If:Else
Set SORTBY=Name

That works super! Thanks

Sorry for the dumb question....
I want to apply this only to my DOWNLOADS folder, or preferably to have my DOWNLOADS folder always open SORTED by the Modified date.

How do I do that?
How do I use this script?

Thank you for any help.

You don't need the commands above for that.

Folder > Folder Options. In there you can save the current folder format for the folder you are in (and subfolders, if you want).

You can see and edit all your saved folder formats via Settings > Preferences / Folders / Formats.

Thanks for the help, man I hate being so dumb :frowning:
How do I get to "Folder > Folder Options

I found the "Settings > Preferences / Folders / Formats" OK but there was no DOWNLOADS saved folder.

Thank you

Never mind, I finally found it....
Thank you for your patience...

With apologies - my dev skills are Zero. Where do I go to insert the code that will let me add this button? Thanks.

See here.

2 Likes

My man! Thanks. Worked like a charm. Much appreciated.

Linked from the FAQs and also the Forum Help menu at the top of the page (which both have lots of other useful information in them):

1 Like

Thanks Leo. Very helpful. Much appreciated.