Jump to content

windows with the same title


johnyV
 Share

Recommended Posts

hello,

I am installing a program that opens up 5 different windows with all the same tittle ! very frustrating.

I got a very basic code. this is near the end of the installation and the installation goes a little like this:

loading window, question window, loading window #2, another question window, loading window #2 resumes, a third question window, loading window #2 finished and 2 more question window appear. (looking through the forum posts I saw lots of complaints on being specific so hope ur following me). Anyways they all have the SAME tittle and class!!

I tried using the gethandle but I guess it does not read the msgbox text or maybe I am doing it wrong.

the sleep in my code is an approximate time on how long it takes for the question window to pop up. I would like to get rid of that.

My main question is how would I tell my code to wait for a window with the same same as the window already running. Then send a key stroke, and let the loading window resume... and wait for another window of the same name to appear and send an other key stroke.

hope someone can help me :S

thanx

CODE
WinWaitActive("Installation de Simple Comptable de Sage Édition Experts 2009 - Lancement A")

#installatation pause

sleep(90000)

##send ("{enter}")

##WinWaitActive("Installation")

sleep(90000)

send ("{enter}")

sleep(1000)

WinWaitActive("Installation de Simple Comptable de Sage Édition Experts 2009 - Lancement A")

send ("{enter}")

sleep(20000)

send ("{altdown}")

sleep(100)

send ("{f}")

sleep(100)

send ("{q}")

send ("{altup}")

Link to comment
Share on other sites

I just put the text that was in the message box e.g "Do you want to put a icon on your desktop".

I verified to make sure the text was spelled prperly and retried several times.

It just didnt seem to even aknowledge the text part of my command.

Link to comment
Share on other sites

I just put the text that was in the message box e.g "Do you want to put a icon on your desktop".

I verified to make sure the text was spelled prperly and retried several times.

It just didnt seem to even aknowledge the text part of my command.

So your answer to Larry is "No". You still need to try just checking the windows with AU3Info.exe as he suggested. If they are not standard Windows API dialog boxes, the text might not be visible to AutoIt (graphical text, Flash, etc.).

You could also run something like this while they are up to see if there is unique text visible:

$sWinTitle = "Installation de Simple Comptable de Sage Édition Experts 2009 - Lancement A"
$avWinList = WinList($sWinTitle)
For $n = 1 to $avWinList[0][0]
    ConsoleWrite("Window " & $n & ":  Text:  " & WinGetText($avWinList[$n][1]) & @LF)
Next

But that won't show you anything the Window Info Tool wouldn't show.

:mellow:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Alright, I copied and pasted the text right out of the ''visible text'' tab in the autoit info tool,

then I modified my line in *.au3 to look like this.

CODE
WinWaitActive("Installation de Simple Comptable de Sage Édition Experts 2009 - Lancement A", "OK L'addiciel de Simple Comptable a été ajouté à Microsoft Outlook. Ce composant sera disponible la prochaine fois que vous lancerez Microsoft Outlook.", 5)

sleep(5000)

send ("{enter}")

If I take over and press enter myself at that point, the installatation continues.

''

OK

L'addiciel de Simple Comptable a été ajouté à Microsoft Outlook. Ce composant sera disponible la prochaine fois que vous lancerez Microsoft Outlook.

''

wat am I doing wrong?

Link to comment
Share on other sites

I think for one a control click would be better, and maybe a do until winactive(all that french stuff) = 0

well I dont really know how the controlclick works, but I did take the code from post #5 and made a seperate script. All i added was a sleep(5000) so that it would give me time to switch windows.

There seemed to be no problem it did as it was suppose to.

The problem with 'do until' is that my other window is still running, it hasnt finish installing. This new window just pops up in mid installation and has the same name.

doesnt seem like the text is even being accounted for.

Link to comment
Share on other sites

Alright, I copied and pasted the text right out of the ''visible text'' tab in the autoit info tool,

then I modified my line in *.au3 to look like this.

WinWaitActive("Installation de Simple Comptable de Sage Édition Experts 2009 - Lancement A", "OK L'addiciel de Simple Comptable a été ajouté à Microsoft Outlook. Ce composant sera disponible la prochaine fois que vous lancerez Microsoft Outlook.", 5)
sleep(5000)
send ("{enter}")

If I take over and press enter myself at that point, the installatation continues.

''

OK

L'addiciel de Simple Comptable a été ajouté à Microsoft Outlook. Ce composant sera disponible la prochaine fois que vous lancerez Microsoft Outlook.

''

wat am I doing wrong?

That won't work because it won't find that as a single undelimitted string.

All you need is a single unique string for that window. Something like:

$sTitle = "Installation de Simple Comptable de Sage Édition Experts 2009 - Lancement A"
$sText = "Ce composant sera disponible la prochaine fois que vous lancerez Microsoft Outlook."
WinWaitActive($sTitle, $sText, 5)
ControlSend ($sTitle, $sText, "", "{enter}")

:mellow:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

it seems that your are automating an installation

if you are , it will be easier for you to use AU3Record 3.1

it is named ScriptWriter in Scite Folder in StartMenu

after you are finished recording the setup you can read

the script and try to understand it

it is not a very flexible way since the automating will be

on the screen but at least it will give you a base to work on

AU3Record 3.1 Path (Only if you Have SciteEditor )

C:\Program Files\AutoIt3\SciTE\ScriptWriter\AU3Record.exe

Edited by komalo
[font="Palatino Linotype"][size="3"]AutoIt Script Examples :[/size][/font][font="Palatino Linotype"][size="3"]_CaptureBehindWindowGlass CMD for Windows Vista/Seven[/size][/font][left][/left][font="Palatino Linotype"][size="3"]Non AutoIt Script programs : Border Skin - Aero Glass On XP[/size][/font]
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...