Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

error while running the script


  • Please log in to reply
3 replies to this topic
rnagulapalle
  • Members
  • 14 posts
  • Last active: Aug 28 2014 05:44 PM
  • Joined: 19 Aug 2014

I have below code which installs a filter. Below code working as expected BUT If I remove MsgBox statements its not executing anything.

I noticed that every MsgBox is halting script. So first MsgBox is halting until .exe file uncompresses. Is there any soltuion that I can check .exe file is uncompressed completely. I can tell script that execute in Synchronously like PHP script.

Please help out.

 

 

#SingleInstance Force
#NoTrayIcon
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
SetTitleMatchMode, 2

    Run, BarracudaWSASetup.exe
   
    MsgBox, 4, Confirmation test, Would you like to continue? (press Yes or No)
    WinActivate,  Web Security Agent - InstallShield Wizard
    IfMsgBox Yes    
        IfWinActive,  Web Security Agent - InstallShield Wizard
        {
            ControlClick, Button1, Web Security Agent - InstallShield Wizard, , Left, 1
            ;MsgBox, 4, Confirmation test, Would you like to continue? (press Yes or No)
            ;IfMsgBox Yes
            MsgBox, Test1
            ControlClick, Button6, Web Security Agent - InstallShield Wizard, , Left, 1
        }
    
        return



girlgamer
  • Moderators
  • 3263 posts
  • Last active: Feb 01 2015 09:49 AM
  • Joined: 04 Jun 2010

If the software provides a window once it's active you could use that to check if the installation has proceeded
example below. You can also make an image of the button6 that you have to click on to see if that image is present
on the screen before you proceed. You could also add images for both buttons so you know to click on them
when they appear on the screen instead of using the MsgBoxes.

SetTitleMatchMode, 2 ;<-- Add this

Run, BarracudaWSASetup.exe

WinWaitActive, Web Security Agent ;<-- insert this line
WinActivate,  Web Security Agent - InstallShield Wizard
IfWinActive,  Web Security Agent - InstallShield Wizard
{ ControlClick, Button1, Web Security Agent - InstallShield Wizard, , Left, 1
  loop 
  { ImageSearch, px, py, 0,0,%A_ScreenWidth%,%A_ScreenHeight%, *5 %pathtoimagedirectory%\Button6.png
    err := Errorlevel
    If (err = 0)[/color]
    { ControlClick, Button6, Web Security Agent, Left 1
      sleep 1000
      break[/color]
    }
    If (err = 2)
    { MsgBox,0x1000,,Search Failed -- Undefined error!
      pause
    }
  }
}
return

The universe is a wondrous place! The faster you create unbreakable code, the faster the universe creates people that can break it. All scripting follows the rule Rule Of Twos -- 1) Good, 2) Fast 3) Cheap -- pick any Two.
I guarantee absolutely nothing about any code I provide except that it works in my machine. ●
MMO Fighter   KeyLooperDemo   Key Spammer   TinyClickRecorder  GGs Password Generator.ahk
For the newest version of AutoHotkey and some killer scripts go here.
Rock-on%20kitten.gif


rnagulapalle
  • Members
  • 14 posts
  • Last active: Aug 28 2014 05:44 PM
  • Joined: 19 Aug 2014

Thank you so much for your help and code.Will try this and see.



rnagulapalle
  • Members
  • 14 posts
  • Last active: Aug 28 2014 05:44 PM
  • Joined: 19 Aug 2014

I have window with two input fields and a check box.

I want to select the inputText field and enter/send text. Trying to find control but lil confused. Should I use InputBox control? can you please give me some sample script.

I have input field with name "RichEdit20W1"

 

And in my code, ControlClick sometimes working sometime not. Do you know any reason?

 

Here is the sample code i have

ControlClick, Button6, Web Security Agent - InstallShield Wizard, , Left, 1

And i set SetTitleMatchMode, 2 ;<-- Add this in my code