FARRCloneWithDatestamp is a FARR helper tool to make a datestamped copy of a currently selected file in Explorer. The copy is placed in the same folder.
Have you ever done ctrl+C ctrl+V on a file and then edited its name, perhaps added a datestamp in order to keep track of which copy is more recent than the others? Then this might just be a tool for you.
1 paste the code into a text editor and save as FARRCloneWithDatestamp.ahk and then compile it (you need http://ahkscript.org/
2 store the compiled FARRCloneWithDatestamp.exe in some folder
3 create a FARR alias like this
Clone selected with datestamp | C:\some\folder\FARRCloneWithDatestamp.exe %LASTHWND%
To use it open Explorer and select a file you want to create a clone of. Press your FARR hotkey, type "clo" and when the alias shows press enter.
Next to your "file.txt" you should now see "file -- 20151213092801.txt" .
x = %1% ;hwnd parameter from FARR
;FARRCloneWithDatestamp -- a helper tool for FARR
;what it does:
;focus the window that matches input parameter hwnd
;if explorer window: get selected files, parse first file
;make a copy of "file.ext" as
;"file -- [datestamp yyyymmddhhmmss].ext" in the same folder
;report status, exit
if x =
WinGetClass, xclass, ahk_id %x%
if xclass != CabinetWClass ;exit if not Explorer win
WinActivate, ahk_id %x%,
ifwinNotactive, ahk_id %x%
clip := ClipBoardAll
send ^c ;copy
if errorlevel != 0
Loop, Parse, clipboard, `n, `r
p := a_loopfield ;first file in selection
clipboard := clip ;restore
if InStr( FileExist(p), "D")
splitpath, p, pname,pdir,pext,pnoext
FileCopy, %p%, %pdir%\%pnoext% -- %A_now%.%pext%
tooltip, Clone %pdir%\%pnoext% -- %A_now%.%pext% created
tooltip, ERROR. Failed to clone %pname%