Jump to content

Can AutoIt do this?


Recommended Posts

@Nologic,

That thing about harcoding the path.. yea I never do that in all actuality and that was one of the things on my shortlist to alter in the script. And thank you for pointing out how to do it.

Regarding the SpywareBlaster script; adding the 1, 1 to the MouseClick statements sure sped things up quite a bit. It took me a little while to understand what you meant at first in terms of eliminating the Sleep commands but I think I got the hang of that. Unfortunately I seem to be picking out all of the real doozies to try and automate.

My next victim is Symantec Client Security's ALEScan.exe. If you're not familiar with it, this app scans your drive for any applications that are defined in the firewall policy and then plugs the rules for them into your firewall configuration. The window is actually an Internet Explorer window running a script. I'm not exactly sure what they're doing to achieve this. The only way that I figured it out was when I had corrupted file somewhere and when I ran ALEScan.exe, I received an error message about script errors, "do you want to continue running scripts in this window..." that whole bit.

Soooo.. using AutoIt's window information tool on this little application gives you squat. Sending keyboard commands works, something more than I can say for SpywareBlaster, but the window title never changes, none of the buttons or anything at all gives a control name or ID. I tried the little trick WinSetTitle that you showed me, but the title never changes. And to make this completely maddening, there isn't any text that I'm able to key on. It really appears that Sleep is indeed the only option here. And that sucks, because this program's performance is incredibly dependant upon hard drive speed, fragmentation, the number of files in the drive, CPU speed, etc. So using a least common denominator philosophy, I'd have to let this thing sleep for like 5 minutes in order to account for a worst case scenario.

Last thing.. as good as the online help is for AutoIt, it sure is vast. There's just an awful lot there to absorb. At first I really thought I was going to go out and save the world with this thing, but I'm starting to realize now that it really takes a lot of tinkering and creativity sometimes to get AutoIt to do just what you want it to do.

Link to comment
Share on other sites


Yeah there is a lot of dinking around to get things to work just right...and AutoIT isn't some magic genie...but it does go a long way to solve a lot of issues.

As for your explorer issue...maybe show the status bar of the window and see if that changes...if so...you may have a way to key the script in to certain events.

Do

Sleep ( 100 )

$tatus = StatusbarGetText( "Internet Explorer" )

Until $tatus = "New Event #1"

ControlSend ( "Internet Explorer", "", "", "{DOWN 3}" )

Do

Sleep ( 100 )

$tatus = StatusbarGetText( "Internet Explorer" )

Until $tatus = "New Event #2"

....

Well some thing along those lines.

Link to comment
Share on other sites

For successfully automating an application within Internet Explorer. It maybe easier to use Window handles as to Window titles because the title can change. I would use the AutoIt Beta with Com capabilities. Some User Defined Functions have been made in this AutoIt Forum Thread. This will allow you to interact with the web content directly, rather then hoping for keyboard commands to do it.

Automating Internet Explorer successfully is no novice area indeed. Com should make it more of a possibility to accomplish. The 3.1.1 version of AutoIt will see nothing of a webpage, or of the controls of the browser.

HTH

Link to comment
Share on other sites

I have now reached a state of scripting nirvana (somehow I feel like a complete loser uttering that statement :P ). I just decided to dive inside AutoItX. Holy smokes! For a diehard VBscript freak like myself this is fantastic. There's plenty of things that VBscript can do that AutoIt cannot and vice versa. This gives me everything (except compiling to an exe file).

Now I'm afraid that I'm going to be going back to retool about a third of my scripts.

Link to comment
Share on other sites

Compiling to exe file?

AutoIt is my total solution, and not a single script is compiled. I use the interpreter AutoIt3.exe to run the Au3 files, like you would run CScript.exe to run VBS files. I use a main script with a For loop to execute each script in the software folder, one after the other. Writing a log file recording start and finish times of each install, as well as the exitcode. I would consider VBScript could do this as well. I also put up a full screen popup window, that displays a picture on it, with a scrolling list of software and a progress bar. VBScript can do the same.

Here is it running a T-12

125min4pa.png

And you are going to retool about a third of your scripts. I have done mine countless times. :)

Edited by MHz
Link to comment
Share on other sites

  • 10 months later...

Not sure how AutoIt3 works but in AutioIt 2 if you

run the "AutoIt Reveal Mode" it shows all the window

titles and window text. Doing this is far more reliable

than using the mouse, at least ov v2. I think on v3 you're

OK because it can lock out the user from the mouse,

I mean in v2 if you moved the mouse that was it, it

threw the whole thing out.

Something like...

WinWait, Window Title v1.0b, Welcome to setup
WinActivate, Window Title v1.0b, Welcome to setup
Send, {TAB}
Send, {TAB}
Send, {TAB}
Send, n
WinWait, Window Title v1.0b, Please choose the destination
WinActivate, Window Title v1.0b, Please choose the destination
Send, {TAB}
Send, {TAB}
Send, n

etc etc (or in some cases etc etc etc etc etc etc etc etc, lol)

Where tab just moves to the correct button and sends

"n" which would be "Next" button.

I never use the mouse but then, I never use AutoIt3, was too

scared of all that new code :blushing:

Yes, just use the v2 to v3 converter I know, but it never works!

Link to comment
Share on other sites

@LeveL

The "AutoIt Reveal Mode" is almost the same as the AutoIt3 "AutoIt Info Tool".

And the MouseClick, why not go for the control directly as with AutoIt3 ControlClick.

When I used AutoIt2 years ago, it was inflexiable to control installations. Sure it was and perhaps still good compared to other automation scripts, but with AutoIt3, I can do so much more with structured programming techniques. Sorry, but the days of the AutoIt2 are long gone for me, and I say goodbye to it like a breath of fresh air just come along.

Don't be scared, if your going to waste your time, then waste it on improving your ability with AutoIt3. :)

General help is here for AutoIt users as well as the great unattended help here.

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
  • Recently Browsing   0 members

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