I got the code below from the above link, and I'm just wondering if I can make it to apply this sorting for 2 specific folders upon launching the script instead of needing a hotkey to trigger? I'm thinking of using a winactive title, but I still prefer to specify a path for reliability. Are there better ideas that I'm not thinking of? Thanks!
Code: Select all
#IfWinActive ahk_class CabinetWClass ahk_exe explorer.exe
F1::
For oWin in ComObjCreate("Shell.Application").Windows {
If WinActive() != oWin.HWND
Continue
oWin.Document.GroupBy := "System.ItemTypeText"
oWin.Document.SortColumns := "prop:-System.ItemNameDisplay;"
Return
}
Return
#IfWinActive