Last active
February 26, 2024 07:27
-
-
Save tablacus/06e984f22ee56810bdf4d14edbc689a3 to your computer and use it in GitHub Desktop.
Reane current folder -Tablacus Explorer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const FolderItem = FV.FolderItem; | |
if (api.GetAttributesOf(FolderItem, SFGAO_CANRENAME)) { | |
const s = api.GetDisplayNameOf(FolderItem, SHGDN_FOREDITING | SHGDN_INFOLDER); | |
InputDialog(FolderItem.Path, s, function (r) { | |
if (/[\\\/:,;\*\?"<>\|]/.test(r)) { | |
MessageBox(api.LoadString(hShell32, 4109), null, MB_ICONSTOP | MB_OK); | |
return; | |
} | |
if ("string" === typeof r && s != r) { | |
try { | |
FolderItem.Name = r; | |
} catch (e) { | |
MessageBox((api.LoadString(hShell32, 6020)).replace("%1!ls!", (api.sprintf(99, "0x%x", e.number)).replace("%2!ls!", s), null, MB_ICONSTOP | MB_OK)); | |
} | |
} | |
}); | |
} | |
return S_OK; |
Author
tablacus
commented
Feb 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment