Jump to content

Auto-click "Rename" in EasyRecovery 6


gerardsweeney
 Share

Recommended Posts

Hello, all..

This is probably of limited use, but it saved me a great deal of hair-pulling.

Easy Recovery 6 by OnTrack has a slightly annoying feature when recovering files.

If it attempts to recover multiple versions of a file to a location, it'll prompt saying that the file already exists - do you want to skip, rename etc. Each time. With no apparent way of remembering your option.

I cobbled together the following laughably poor script so that it automatically adds _renameX to the file. If the file ends in an a ".abc" type extension, it puts the _renameX before the . so as to not break the filetype.

I have no doubt anyone with even a modicum of AU3 experience will wet themselves at my coding, so please feel free to improve on it. It served my requirements :oops:

Dim $RenameNum
$RenameNum = 0

$App = "EasyRecovery.exe"
While ProcessExists($App)
ToolTip("Number of renames = " & $RenameNum)
WaitForRename()
Sleep(100)
Wend
msgbox(0, "", "All done - renames = " & $RenameNum)
EXIT

; ==================================================
Func WaitForRename()
$Title = "File Exists"
ToolTip("Waiting for rename Window to exist")
WinWait($Title, "", 10)
ToolTip("Waiting for rename window to be active")
WinActivate($Title)
$WinWA = WinWaitActive($Title, "", 10)
If $WinWA = 0 then
Return
EndIf
Send("{End}")
; So we're at the end of the rename text box
; Get the filename
$Text = WinGetText($Title)
$TextSplit = StringSplit($Text, @LF, 1)
If $TextSplit[0] = 12 then
$OldFile = $TextSplit[1]
$OldFileLen = StringLen($OldFile)
$OldFileExt = StringRight($OldFile, 4)
  ; If it's an extension, jump back before the extension
  If StringMid($OldFileExt, 1, 1) = "." then
  Send("{LEFT}{LEFT}{LEFT}{LEFT}")
  EndIf
EndIf
$RenameNum = $RenameNum + 1
If $RenameNum < 10 then
$RenamePadding = "0"
Else
$RenamePadding = ""
EndIf
Send("_Rename" & $RenamePadding & $RenameNum)
ControlClick($Title, "", 1018, "left", 1)
EndFunc
; ==================================================
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...