Jump to content

Failed Execution---- AUTOIT compiled script/exe stopping abruptly during execution


Recommended Posts

Alright, at least you are trying stuff, although your attempts are kind of pathetic (no offense).  I told you to keep away from MouseClick.  Anyway, let's move your script a step further.

#include <Constants.au3>

Opt("MustDeclareVars", True)  ; this is good practice, use it
Opt("WinTitleMatchMode", -2) ; to let you use any part of a window title (minus means Case insensitive)

; Activate the application
Local $hWnd = WinActivate("AccuRenderStudio")
If Not $hWnd Then Exit MsgBox($MB_OK, "Error", "Unable to locate AccuRenderStudio window")
WinWaitActive($hWnd)

; Select drop down option
ControlCommand($hWnd, "", "HwndWrapper[ArStudioWpf.exe;;9ac232e9-2be7-47fe-902e-afed50e034f0]", "ShowDropDown", "")
If @error Then Exit MsgBox($MB_OK, "Error", "Unable to show drop down")
ControlCommand($hWnd, "", "HwndWrapper[ArStudioWpf.exe;;9ac232e9-2be7-47fe-902e-afed50e034f0]", "SelectString", "f1")
If @error Then Exit MsgBox($MB_OK, "Error", "Unable to select string")
Sleep(500) ; give time to the application to apply the change

; Click start button and wait AutoSave window to appear
ControlClick($hWnd, "", "control name of the start button") ; instead of MouseClick (348,71)
Local $hWnd2 = WinWait("AutoSave") ; instead of MouseClick (1178,38)
WinSetState($hWnd2, "", @SW_MAXIMIZE)

Make it work. 

ps. Adding error handling is also very important, it helps you understand what is going on...

Link to comment
Share on other sites

The code is not giving me any error but i have not seen any execution

 

#include <Constants.au3>

Opt("MustDeclareVars", True)  ; this is good practice, use it
Opt("WinTitleMatchMode", -2) ; to let you use any part of a window title (minus means Case insensitive)

; Activate the application
Local $hWnd = WinActivate("AccuRenderStudio")
If Not $hWnd Then Exit MsgBox($MB_OK, "Error", "Unable to locate AccuRenderStudio window")
WinWaitActive($hWnd)

; Select drop down option
ControlCommand($hWnd, "", "HwndWrapper[ArStudioWpf.exe;;9ac232e9-2be7-47fe-902e-afed50e034f0]", "ShowDropDown", "")
ControlCommand($hWnd, "", "HwndWrapper[ArStudioWpf.exe;;9ac232e9-2be7-47fe-902e-afed50e034f0]", "SelectString", "f1")
Sleep(500) ; give time to the application to apply the change

; Click start button and wait AutoSave window to appear
ControlClick($hWnd, "", "control name of the start button") ; instead of MouseClick (348,71)
Local $hWnd2 = WinWait("AutoSave") ; instead of MouseClick (1178,38)
WinSetState($hWnd2, "", @SW_MAXIMIZE)

$loops = 2500
for $a=0 to 2500
ConsoleWrite("This is a: " & $b  &@CRLF)
next
ConsoleWrite ("Inner loop:"&loops& " set finished"&@CRLF)
$loops+=2500

What can i do ? I added a loop function and got rid of the error checking mechanism.

What do you think ?

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...