After some digging in the forums, I came up with this script that does part of the job, but doesn't change the name of the file - it only copies and pastes the file and turns on renaming mode
Code: Select all
^+b:: ;explorer - copy and paste focused file, focus new file, edit new file name
hWnd := WinExist("A")
for oWin2 in ComObjCreate("Shell.Application").Windows
if (oWin2.HWND = hWnd)
{
oWin := oWin2
break
}
oWin2 := ""
if !oWin
|| ((vPath := oWin.Document.FocusedItem.path) = "")
|| !FileExist(vPath)
{
oWin := ""
return
}
vDate := A_Now
Clipboard := ""
SendInput, ^c
vCount := oWin.Document.Folder.Items.Count
vDir1 := oWin.Document.Folder.Self.Path
oArray := []
for oItem in oWin.Document.Folder.Items
if !(oItem.path = "")
oArray["z" oItem.path] := 1
ClipWait, 3
if ErrorLevel
{
MsgBox, % "error: failed to copy file"
return
}
SendInput, ^v
Loop, 300
{
vCount2 := oWin.Document.Folder.Items.Count
if (vCount2 > vCount)
break
Sleep, 10
}
for oItem in oWin.Document.Folder.Items
if !(oItem.path = "")
&& !oArray["z" oItem.path]
{
;SVSI_FOCUSED = 0x10 ;SVSI_ENSUREVISIBLE := 0x8
;SVSI_DESELECTOTHERS := 0x4 ;SVSI_EDIT := 0x3
;SVSI_SELECT := 0x1 ;SVSI_DESELECT := 0x0
oWin.Document.SelectItem(oItem, 0x1F)
break
}
return