Ava*_*tar 6 windows keyboard-shortcuts rename
在复制和重命名文件(Windows 资源管理器)时,我厌倦了这些步骤:

Windows 中是否没有复制文件并立即处于重命名模式的功能或快捷方式?
也许这是一个复杂的问题,但每天这样做 50 次至少可以节省 50 * 2 次键盘敲击。
PS:我知道你可以使用 CMD 来完成copy "file1.txt" "file2.txt",但我想直接在 Windows 资源管理器中完成。
; Press F1 in Explorer to copy and manually rename the copy of the selected file
; - If the size of the selected is less 50 MB, directly in the explorer
; - otherwise using an input box (because the copying process takes more time)
#If WinActive("ahk_class CabinetWClass")
$F1::
ClipSaved := ClipboardAll
clipboard := ""
Send, ^c
ClipWait, 2
if (!ErrorLevel)
{
SplitPath, clipboard,, dir, ext, NameNoExt
If (ext = "")
{
MsgBox, No file selected
clipboard := ClipSaved
return
}
FileGetSize, size, %clipboard%, M
If (size < 50)
{
Sleep, 100
Send, ^v
Sleep, 500
; Send, {F2} ; or
SendInput, {F2}%NameNoExt% ; if you want to remove " - Copy"
}
else
{
InputBox, UserInput, Filename, Enter a name for the file,, 350, 120,,,,, %NameNoExt%
if (!ErrorLevel)
FileCopy, %clipboard%, %dir%\%UserInput%.%ext%, 1
}
}
else
MsgBox, No file selected
Sleep, 300
clipboard := ClipSaved
return
#If
Run Code Online (Sandbox Code Playgroud)