The greatest tool ever has once again come to the rescue...AutoHotkey!
To be able to just rename the basename I was able to create an AHK script that always auto waits for the rename popup, auto removes the file extension and saves it to auto insert back in before finalizing the rename upon pressing the "Enter" key.
https://i.postimg.cc/ZnpcbtM2/x2-Animation.gif
Not like anyone needs the script but here it is if interested...
Code: Select all
SetTimer, Auto_x2NewItemName
Auto_x2NewItemName:
If WinExist("New item name: ahk_class #32770 ahk_exe xplorer2_64.exe")
{
WinWait, New item name: ahk_class #32770 ahk_exe xplorer2_64.exe,, 5
x2SavedFN := ""
x2SavedEX := ""
x2NewItemName := ""
ControlGetText, x2NewItemName, Edit1, New item name: ahk_class #32770 ahk_exe xplorer2_64.exe
If x2NewItemName contains .bak
{
SendInput {End}
} Else {
x2SavedFN := RegExReplace(x2NewItemName, "(.+?)(\.[^.]*$|$)", "$1") ; Filename
x2SavedEX := RegExReplace(x2NewItemName, "(.+?)(\.[^.]*$|$)", "$2") ; Extension
ControlSetText, Edit1, %x2SavedFN%, New item name: ahk_class #32770 ahk_exe xplorer2_64.exe
SendInput ^a
}
WinWaitClose, New item name: ahk_class #32770 ahk_exe xplorer2_64.exe
}
Return
#IfWinActive New item name: ahk_class #32770 ahk_exe xplorer2_64.exe
Enter::
ControlGetText, x2NewItemName, Edit1, New item name: ahk_class #32770 ahk_exe xplorer2_64.exe
If x2NewItemName contains .bak
{
SendInput {Enter}
} Else {
SendInput {End}%x2SavedEX%{Enter}
}
Return
!Z:: ; Alt+Z - Return Saved Full Filename / Remove Extension .bak
x2SavedEX := ""
ControlSetText, Edit1, %x2NewItemName%, New item name: ahk_class #32770 ahk_exe xplorer2_64.exe
If x2NewItemName contains .bak
{
x2RemoveBAK := RegExReplace(x2NewItemName, "\.bak$", "")
ControlSetText, Edit1, %x2RemoveBAK%, New item name: ahk_class #32770 ahk_exe xplorer2_64.exe
SendInput {Enter}
}
SendInput {End}
Return
!B:: ; Alt+B - Auto Append Extension .bak
ControlSetText, Edit1, %x2NewItemName%, New item name: ahk_class #32770 ahk_exe xplorer2_64.exe
SendInput {End}.bak{Enter}
Return
Took some brainstorming but sometimes I even surprise myself!
