Sign in to follow this  
Followers 0
ssnake

[Help] How to proceed to next step after a text disappear?

10 posts in this topic

Hi guys.

My name is Fernando [from Brazil] and this is my first post.

-

I searched for a solution but with no success, on how to procceed to next step in my script after a text dissappear from a window.

Example: I have a window that show in statusbar the message "Counting", and the message disappear when the task (counting) ends.At this point, I need to procceed to next step in the script.

This may be a silly question, but I really cant find the answer.

Thanks

Share this post


Link to post
Share on other sites



Hi, ssnake, welcome to the forum. Can you please post your script, so we can see what you're attempting to do? Otherwise we're just guessing :)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Hi, ssnake, welcome to the forum. Can you please post your script, so we can see what you're attempting to do? Otherwise we're just guessing :)

Oh, sorry.

Please note that's just a test script that I'm using with SAP frontend

#include <Excel.au3>
#include <Array.au3>
dim $Linha = 1
$oExcel = _ExcelBookOpen("O:\080-CONSTRUCAO E MONTAGEM\080-100-EQUIPAMENTOS\Planilha Pulo do Gato.xlsx")
_ExcelSheetActivate($oExcel, "Plan1")
$Matriz = _ExcelReadSheetToArray($oExcel)
_ExcelBookClose($oExcel)
while $Linha <> (UBound($Matriz,1)-1)
WinActivate("Relatório do operador")
WinWaitActive("Relatório do operador")
send("^a")
send($Matriz[$Linha][1])
send("{DOWN}")
send("^a")
send("C279")
send("{DOWN}{ENTER}{DOWN}")
send("^a")
send($Matriz[$Linha][2])
send("{ENTER}")
WinWaitActive("Selec.elemento PEP")
sleep(2000)
;Here I need to test if the "Counting" message disappeared. For now, the sleep helped a little
send("{ENTER}")
WinWaitActive("Relatório do operador")
send($Matriz[$Linha][3])
send("{ENTER}")
sleep(1000)
send($Matriz[$Linha][4])
send("{TAB}")
send($Matriz[$Linha][5])
send("{ENTER}")
sleep(1000)
send("^s")
sleep(1000)
$Linha = $Linha+1
wend

Check the help file for StatusbarGetText.

I'll check it. Thanks

Share this post


Link to post
Share on other sites

Check the help file for StatusbarGetText.

no luck. StatusbarGetText will not work in my case. Thanks anyway

Share this post


Link to post
Share on other sites

I'm not absolutely certain exactly what you mean by statusbar, but could you not use WinExits(), with visible text, in a loop to identify whether the process has completed (or am I completely missing the point)


[font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font]

Share this post


Link to post
Share on other sites

I'm not absolutely certain exactly what you mean by statusbar, but could you not use WinExits(), with visible text, in a loop to identify whether the process has completed (or am I completely missing the point)

Yup, a loop can help, but I was just wondering if theres no way to do this more effectively.

But thanks guys

Share this post


Link to post
Share on other sites

Have you used the AutoIt Window Info Tool on the window you're trying to wait on? If you can capture both the title and the text you could do something like this:

While WinExists("title of window", "Counting")
   Sleep(500)
WEnd

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Yup, a loop can help, but I was just wondering if theres no way to do this more effectively.

If you just want your script to wait until an event, then using a loop with a small sleep interval to reduce memory usage is best (JLogan3o13 just posted an example). If you want your script to remain active while waiting for an event then using something like AdlibRegister is a possibility. I don't think it applies here though.

Edited by czardas

Share this post


Link to post
Share on other sites

Have you used the AutoIt Window Info Tool on the window you're trying to wait on? If you can capture both the title and the text you could do something like this:

While WinExists("title of window", "Counting")
Sleep(500)
WEnd

If you just want your script to wait until an event, then using a loop with a small sleep interval to reduce memory usage is best (JLogan3o13 just posted an example). If you want your script to remain active while waiting for an event then using something like AdlibRegister is a possibility. I don't think it applies here though.

You guys are awesome. Thanks!

Share this post


Link to post
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
Sign in to follow this  
Followers 0