If screen reads "out of actions", then send text

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
probbins
Newbie
Posts: 9
Joined: Wed Jun 01, 2011 9:20 pm

If screen reads "out of actions", then send text

Post by probbins » Thu Jun 02, 2011 4:26 pm

In case you aren't able to see the image below, it's a program window that reads "NOW UPDATING HISTORY AND OTHER DATA"


Image


My problem is, when I'm running a process that updates history, it may reach an account that is out of actions.
This causes the process to Halt until the user manually enters "C" and "ENTER."
So essentially, you may have to press "C" and "ENTER" hundreds of times.
Right now I have Macro scheduler running the process and it waits for the screen to Read "PROGRAM COMPLETE" before exiting.

Is it possible to have Macro Scheduler read the text on the screen, if the texts reads "YOU ARE OUT OF ACTIONS"
Then Macro Scheduler would execute the following code...

Code: Select all

Send>C
Press Enter 
And then Loop this action, to continuously look for screen text "YOU ARE OUT OF ACTIONS" until the screen reads "PROGRAM COMPLETE"

I am pretty unfamiliar with the whole looping process, so any help at all would be much appreciated!

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Thu Jun 02, 2011 7:24 pm

The screen looks like a mainframe terminal emulator (maybe 3270?). Many programs of this type have special API functions accessible by DLL calls to retrieve the text on the screen. This method would be more reliable than simple image recognition.



As for looping....
here is a simple example of looping...


Label>Start

//some code here
Goto>Start

See the help file for other methods of constructing loops.

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Thu Jun 02, 2011 7:26 pm

The screen looks like a mainframe terminal emulator (maybe 3270?).

Many programs of this type have special API functions accessible by DLL
calls to retrieve the text on the screen. This method would be more
reliable than simple image recognition.



As for looping....
here is a simple example of looping...


Label>Start

//some code here
Goto>Start

See the help file for other methods of constructing loops.[/quote]

probbins
Newbie
Posts: 9
Joined: Wed Jun 01, 2011 9:20 pm

Post by probbins » Fri Jun 03, 2011 2:42 pm

I just checked with our IT department and they advised me that the program is I use to run this process is very basic and doesn't support API functions.

Thanks for getting me started in the right direction though!

I was looking at the looping code, and it got me thinking... would something like this be possible? And if so, would the below code be correct or is there a better way of doing this?
In short, I'm attempting to "Look for screen text OUT of ACTIONS.
if found... send commands,
if not... look for screen text PROGRAM COMPLETE,
if PROGRAM COMPLETE is not found then repeat from beginning (looking for out of actions) until Program complete screen text is found.

Label>Start
Let>WST_TIMEOUT=5
WaitScreenText>YOU ARE OUT OF ACTIONS

If>WW_RESULT=FALSE
Goto>Program Complete
Endif

If>WW_RESULT=TRUE
Send>C
Press Enter
Goto>Start
Endif



Label>Program Complete
Let>WST_TIMEOUT=5
WaitScreenText>PROOGRAM COMPLETE

If>WW_RESULT=FALSE
Goto>Start
Endif

If>WW_RESULT=TRUE
CloseWindow>"Current Program Here"
Endif


And then the rest of the script would be continued here at this point... or is there a more efficient way of doing this?

probbins
Newbie
Posts: 9
Joined: Wed Jun 01, 2011 9:20 pm

Post by probbins » Fri Jun 03, 2011 2:45 pm

I just checked with our IT department and they advised me
that the program that I use to run this process is very basic and doesn't support API functions.

Thanks for getting me started in the right direction though!

I was looking at the looping code, and it got me thinking... would something like this be possible?
And if so, would the below code be correct or is there a better way of doing this?
In short, I'm attempting to "Look for screen text OUT of ACTIONS.
if found... send commands,
if not... look for screen text PROGRAM COMPLETE,
if PROGRAM COMPLETE is not found then repeat from beginning
(looking for out of actions) until Program complete screen text is found.

Label>Start
Let>WST_TIMEOUT=5
WaitScreenText>YOU ARE OUT OF ACTIONS

If>WW_RESULT=FALSE
Goto>Program Complete
Endif

If>WW_RESULT=TRUE
Send>C
Press Enter
Goto>Start
Endif



Label>Program Complete
Let>WST_TIMEOUT=5
WaitScreenText>PROOGRAM COMPLETE

If>WW_RESULT=FALSE
Goto>Start
Endif

If>WW_RESULT=TRUE
CloseWindow>"Current Program Here"
Endif


And then the rest of the script would be continued here at this point...
or is there a more efficient way of doing this?

probbins
Newbie
Posts: 9
Joined: Wed Jun 01, 2011 9:20 pm

Post by probbins » Thu Jun 09, 2011 1:55 pm

I apologize... spoke with our IT department again this morning and they misunderstood the question that I was asking.
Long story short, yes the program supports API functions. It's called AnzioWin.

In your post before, you mentioned talked about using API functions accessible by DLL calls to retrieve the text on the screen.
When it comes to API functions and DLL calls, I am a true novice.
How would I go about doing this?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts