Jump to content

How To Detect When Quickpar Is Done?


Recommended Posts

i'm trying to write a script to start a Quickpar 0.9.1 window to check on some files i downloaded, and then to wait untli the check is completed before launching on to the next .par2 file in the same directory, and then onto the next until all .par2 files have completed checking.

any ideas?

Link to comment
Share on other sites

  • Moderators

I've never used the program before, but maybe this will get you started:

$file = "Whatever file you want here"
Run(@ProgramFilesDir & "\QuickPar\QuickPar.exe")
WinWaitActive("QuickPar")
;This clicks the 'Add Files' button
ControlClick("QuickPar", "", "Button2")
WinWaitActive("Select files")
ControlSetText("Select files", "", "Edit1", $file)
ControlClick("Select files", "", "Button2")
;;;
;Any options you want to set here
;;;
;This clicks the create button
ControlClick("QuickPar", "", "Button10")
WinWaitActive("QuickPar -")
While 1
;This gets the text below the progress bar
$Status = ControlGetText("QuickPar -", "", "Static1")
;This waits for it to say 'Successfully completed'
If StringInStr($Status, "Successfully completed") <> 0 Then ExitLoop
Sleep(100)
WEnd
;This clicks the 'New' button
ControlClick("QuickPar -", "", "Button3")
Edited by big_daddy
Link to comment
Share on other sites

  • Moderators

holy crap! i posted this like not more than 5 mins when you replied!!! YOU'RE AWESOME!! :)

i'll try your script and let u know.

Could you give me an idea of the steps you go through normally. Like what buttons you click, ect...

I don't think this is exactly what you are wanting, but it is a start.

; Shows the filenames of all files in the current directory.
$Search = FileFindFirstFile(@ScriptDir & "\*.par2")
; Check if the search was successful
If $Search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")
Else
; Run the QuickPar Program
    Run(@ProgramFilesDir & "\QuickPar\QuickPar.exe")
    While 1
        $file = FileFindNextFile($Search)
        If @error Then ExitLoop
        WinWaitActive("QuickPar - Select Files To Protect")
    ; Click the 'Add Files' button
        ControlClick("QuickPar", "", "Button2")
        WinWaitActive("Select files")
    ; Set filename
        ControlSetText("Select files", "", "Edit1", $file)
    ; Click the 'Open' button
        ControlClick("Select files", "", "Button2")
    ;;;
    ; Any options you want to set here
    ;;;
    ; Click the 'Create' button
        ControlClick("QuickPar", "", "Button10")
        WinWaitActive("QuickPar -", "Number of source files")
        While 1
        ; Get the text below the progress bar
            $Status = ControlGetText("QuickPar -", "", "Static1")
        ; Wait for it to say 'Successfully completed'
            If StringInStr($Status, "Successfully completed") <> 0 Then ExitLoop
            Sleep(100)
        WEnd
    ; Click the 'New' button
        ControlClick("QuickPar -", "Number of source files", "Button3")
    WEnd
EndIf
; Close the search handle
FileClose($Search)
WinWaitActive("QuickPar - Select Files To Protect")
; Click the 'Exit' button
ControlClick("QuickPar - Select Files To Protect", "", "Button12")
MsgBox(0, "Finished", "All files have been checked.")
Edited by big_daddy
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...