Jump to content

Handling Strings of Array and Dialog boxes


anandnz
 Share

Recommended Posts

I am very new here and seek help to do this small task ..

any help is appreciated. This requires running the batch files directly OR running the batch command via AutoIT.

I am rephrasing my question so that i have luck in response..

String list = ("Donald", "Gavin", "Richard", "Arnold")

For a list of names, i have to run a external tool command ( set PATH=C:\Program Files\Openfile\bin\exe\win32pc;%PATH%

openfile.exe -login admin, admin -file "$cmd" -location -type doc -tst openfile3 ) The $cmd you see picks a string from the list

currently running a batch file and repeating the above commands for all the string list .. which i want to change with autoit.

and concatenates to the command i am running ..

It runs indefinetely until a dialog box named " Complete" turns up.

If Dialog box = "complete"

Then i close the dialog box, and save the file to a location ..

open a success log and say $cmd success

else

close all the dialog box ( basically error boxes)

enter into fail.log say $cmd fail

continue the loop

$cmd ++

; Storing a set of strings which forms the arguments to the third party call
$cmd = ("Donald", "Gavin", "Richard", "Arnold") ;etc

; Run the loop until all the files are completed.
while($cmd)
    
    ; Third Party application commands 
    ; set PATH=C:\Program Files\Openfile\bin\exe\win32pc;%PATH%
    ; openfile.exe -login admin, admin -file "$cmd" -location -type doc -tst openfile3
    ; This prints the all the information of variable $cmd[i] like address, enquiry, etc ... Big file
    
Run( openfile.exe -login admin, admin -file "$cmd" -location -type doc -tst openfile3) 
   ; please advice if i can run the above statments here or should i run the batch file 

; This command for some files take hours to several minutes not sure...
$InitActive = WinGetHandle("[active]") ; Gets the current active window
WinClose("Complete")
While WinGetHandle("[active]") == $InitActive ; Compare that window against the window that is active now
    Sleep(100) ; Do nothing while it doesn't show up
WEnd

; Once complete, a dialog box enters prompting user to enter "OK" 
if WinWaitActive("Complete")
{
Send("{ENTER}")
    
; copy the data to a folder 
   Run ( ; Copy the file here c:\data\output Dataof $cmd[i].doc command file) 
   ; Open Success.log and echo (File $cmd[i] success)append mode
}
 ElseIf 
    ;Open Fail.log and echo (fild $cmd[i] fail ) append mode
    
$cmd ++
Link to comment
Share on other sites

I fixed $cmd loop logic and Run(openfile)

; Storing a set of strings which forms the arguments to the third party call
$cmd = "Donald,Gavin,Richard,Arnold" ;etc
$cmd = StringSplit($cmd, ",")

; Run the loop until all the files are completed.
For $i = 1 To $cmd[0]
    
    ; Third Party application commands 
    ; set PATH=C:\Program Files\Openfile\bin\exe\win32pc;%PATH%
    ; openfile.exe -login admin, admin -file "$cmd" -location -type doc -tst openfile3
    ; This prints the all the information of variable $cmd[i] like address, enquiry, etc ... Big file
    
    Run("openfile.exe -login admin, admin -file " & $cmd[$i] & " -location -type doc -tst openfile3") 
   ; please advice if i can run the above statments here or should i run the batch file 

    ; This command for some files take hours to several minutes not sure...
    $InitActive = WinGetHandle("[active]") ; Gets the current active window
    WinClose("Complete")
    While WinGetHandle("[active]") == $InitActive ; Compare that window against the window that is active now
        Sleep(100) ; Do nothing while it doesn't show up
    WEnd

    ; Once complete, a dialog box enters prompting user to enter "OK" 
    if WinWaitActive("Complete") Then
        Send("{ENTER}")
        
        ; copy the data to a folder 
        Run ("Copy the file here c:\data\output Dataof $cmd[i].doc command file") 
       ; Open Success.log and echo (File $cmd[i] success)append mode
    Else
        ;Open Fail.log and echo (fild $cmd[i] fail ) append mode
    EndIf
        
Next
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...