Jump to content

winWaitActive: title attribute


Recommended Posts

Hi guys,

I'm just new here at the forums and so am I with AutoIT. So far it meets all my requirements for making an unattended install script. When I get it working, that is :lmao:.

I chose to start automating the installation of Fraps (a little program to monitor the fps in games). I used version 2.7.2 of this program. But the nasty thing is that the window titles all begin or include "Fraps 2.7.2: ...". This means that when I use autoIT for recognizing the windows, I need to include the whole window title. This is not quite easy, because when version 2.7.3 is released, I may edit the whole script again.

My question is: can I use some kind of wildcard in the title attribute? Just leaving that blank and depending on the text attribute doesn't seem to work?

Here's my script, for those who want:

run("FRAPS272.EXE")
winWaitActive("Fraps 2.7.2: License Agreement")
controlClick("Fraps 2.7.2: License Agreement", "", 1)
WinWaitActive("Fraps 2.7.2: Installation Folder", "Choose a directory")
controlClick("Fraps 2.7.2: Installation Folder", "Choose a directory", 1)
WinWaitActive("Fraps 2.7.2: Start Menu Folder", "Select the Start Menu folder")
controlClick("Fraps 2.7.2: Start Menu Folder", "Select the Start Menu folder", 1)
WinWaitActive("Fraps 2.7.2: Completed", "Completed")
controlClick("Fraps 2.7.2: Completed", "Completed", 1)
Link to comment
Share on other sites

Hi guys,

I'm just new here at the forums and so am I with AutoIT. So far it meets all my requirements for making an unattended install script. When I get it working, that is :lmao:.

I chose to start automating the installation of Fraps (a little program to monitor the fps in games). I used version 2.7.2 of this program. But the nasty thing is that the window titles all begin or include "Fraps 2.7.2: ...". This means that when I use autoIT for recognizing the windows, I need to include the whole window title. This is not quite easy, because when version 2.7.3 is released, I may edit the whole script again.

My question is: can I use some kind of wildcard in the title attribute? Just leaving that blank and depending on the text attribute doesn't seem to work?

Here's my script, for those who want:

run("FRAPS272.EXE")
winWaitActive("Fraps 2.7.2: License Agreement")
controlClick("Fraps 2.7.2: License Agreement", "", 1)
WinWaitActive("Fraps 2.7.2: Installation Folder", "Choose a directory")
controlClick("Fraps 2.7.2: Installation Folder", "Choose a directory", 1)
WinWaitActive("Fraps 2.7.2: Start Menu Folder", "Select the Start Menu folder")
controlClick("Fraps 2.7.2: Start Menu Folder", "Select the Start Menu folder", 1)
WinWaitActive("Fraps 2.7.2: Completed", "Completed")
controlClick("Fraps 2.7.2: Completed", "Completed", 1)
Lookup Opt(WinTitleMatchMode) in the help file, that should allow easier title matching.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

Default mode of Window Titles is not the complete title. The title starts from the left and can trimmed along any point from there onwards. "Fraps" would be suitable for a title and note that titles are case sensitive.

WinwaitActive() is not required when using Control* functions solely, as they do not require an active window. Winwait() will do well instead.

Link to comment
Share on other sites

Following BigDod's suggestion start your script with

Opt("WinTitleMatchMode", 2)

and then you can use "License", "Installation", "Start" and "Completed" to find the appropriate Window Titles

Cool, thx! That works :lmao:

Now, I'll be asking some more questions in the future, I predict ;). I'm planning to automate all of my 3rd party installation programs and join them in one big script, so I won't have to spend hours on clicking next in numerous install procedures.

This also means that I will be dealing with tens of different installation procedures. Installations such as winzip or fraps are relatively simple. But I have no doubt there will be some nasty ones coming up. I hope you guys will stand me by in hard times o:)

Link to comment
Share on other sites

  • Moderators

You might not always get the answer you want to hear... But someone 95% of the time will answer your question to the best of their ability.

Welcome to AutoIt and the forums :lmao:.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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