Get Ready for the next SPR Update Q3/21

Started by Theo Gottwald, July 28, 2021, 06:02:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Theo Gottwald

For the next Update the SPR has been lifted to a new Dimension of visual Automations.
Sounds like Advertizing?

With this new version the Robot can find any Pattern on Screen within a Part of a second.
So you will need to Locate the Top-Window of the target Application just as before.
But no need to find out "How to get to that GUI-Element" as it was in the Past sometimes.

How do you do it?
You can take the "Human-Eye-Recorder-Tool" and Record the Target as a "Pattern".
A Pattern generally is a small Picture of a Button or Text-Element or WHATEVER.
Its somehow a Picture.

Now using the new Pattern-Commands the Robot can search this Pattern and locate it, click there or do whatever at this Place or nearby.
He can also check if there are several such Patterns - or not.
For example you can find out if a Pattern is ...15 times on a WEB-Site or not.
This makes it easy to check WEB-Sites.

As a side-effect of the new Pattern-Engine the SPR get a lot of Image-Manipulation Commands.
Need to remove a watermark from an Image?
Maybe the SPR can now do it with a few commands.

There is a Sample Script in the help for this at the new ANA.Logic-Command:

' This Script is not intended for removing Copyright Artefacts
' yet i have nothing else at hand so i take such as an example

' We make a IR that is completely filled with the artefacts color

' We load the Picture that contains the unwanted artefacts

' We use the Logic Command to distribute the artefacts
ANA.Logic|2|1|0|A OR B

' Now we remove the artefacts using the "remove-color -with-Tolerance" Command.

This is just one example what you can automatically do with images using the SPR.
Maybe "Remove Background" is also possible.

So what are the new commands?
There are many ANA.-Imageprocessing Commands. Currently some of them are not yet documented.
As you can see with the Script above they are a bit hard to use.
Lots of Parameters. I wanted to make this new thing very Simple.

So we got a Bunch of Dedicated "Pattern-Search Commands".
These are all Commands that you need, build your Script completely using the Pattern-Engine.

Very Simple Example, you record an "Image" or Pattern using the HE-Recorder and save it.
Now you can use the new

And have the Robot click on the Pattern.
Of course there are some Parameters that you can change.
But they are hidden from the User because most often you may not need to change them - they are automatic.
If you want to change them, the 2 new commands:

are used for that.

To keep it simple, The LFP.-Command has just 3 Parameters.
' P1 - Patternfile
' P2 - Coordinate-Shift (Move the target Point by these Cordinates)
' Variable for Result

and the later 2 Parameters are optional.

So a complete Script could be:


And we stay with this easy doing also with the other new Pattern-Commands.
They are:

' IF - you can make a decision base on the fact ifa Patern is found or not.
IFP. - / NFP - If Pattern Found [ELS. ... EIF.]

' Directly Jump to a Label if a Pattern is found or Not
JFP. / JNP. - Jump If Pattern

' Wait for a Pattern to appear or dissappear
WFP. - Wait For Pattern

And we have one new Command that is a part of the "SELECT CASE ... END SELECT" Construct.
Its used if you have multiple Patterns that may appear and you want to react on that.

So the new Command is
CFP. - Case Find Pattern

Its used in Combination with the SCS.-Command like this

STW.Act|TFrmHelp|- Help
' Select Case Construct
' Here comes the first Pattern
' Here comes the second Pattern, number is not limited so you can react on an unlimited Number of Patterns
  PRT.None of the Patterns was found

And because i assume that in many such cases you wouldwant to Jump again to the SCS: if nothing was found,
we have a new Replacement for the ESC. (END SELECT) also: ESL.
Which means "End Select Loop".

STW.Act|TFrmHelp|- Help
' Select Case Construct
' Here comes the first Pattern
' Here comes the second Pattern, number is not limited so you can react on an unlimited Number of Patterns

So in this case the Script will Loop between the SCS. and the ESL. until one of the Patterns was found.
Thats in short the News for the next Update.

Let me add that this way the SPR can now work in any Browser or GUI without having any sort of AddON
it will just do what a human user would do - it will search the Pattern, recognize the Pattern and click whatever.

Then there are other Improvements. The HE-Recorder got a "Distance Tool" for Recording, to avoid Mouse-Over Effects.
And much more.