1. Starting Guide

<< Click to Display Table of Contents >>

Navigation:  1. Starting Guides >

1. Starting Guide

1.5.1 FAQ - How to ...

Previous Top Next


Starting Guide

 

FAQ - How to do several things ...

More specific tips for using the Script language,

-------------------------------------------------------------------

clip0515

 

How do you get the § and the |-Character on non-german Keyboards?

 

Press "ctrl-B". The Editor will give you the § character.

Pressing "ctrl-H" will give you the | (Pipe) Character.

 


clip0516

How to read text from controls

 

To read text from windows, use CFW.

 

STW.ct|PBWindowClass:0|TestApp

SCW.nc|1|SysIPAddress32

CFW.$$TXT|u

 

If CFW. does not work, or if you want to read from within "Browser" or Office-Programms, try GAI.

 


clip0517

 

Numeric parameters and formulas

 

Wherever you have numeric parameters, you can also use a formula. For example:

 

The command PAU. want a numeric parameter first. We could write:

 

' The script will Pause for 5 seconds

PAU.5

 

We can also use a variable here:

 

' The script will Pause for 5 seconds

: §§TIM=5

PAU.§§TIM

 

Now we can also use a formula here. The trick is, that we must put the formula into brackets ( ...).

 

' The script will Pause for 5 seconds

: §§TIM=1

PAU.(§§TIM*5)

 

You can use formulas at most places where numeric parameters are valid. The formula can use all expressions that are valid for the CAL.-command also.


clip0518

 

How to use formulas in decisions

 

There is the mathematical IVV. It is formed like this:

 

IVV. (Any Formula like in CAL.)
 

The brackets (...) are needed so IVV. knows that you want the mathematical IVV.

 

The result is tested against zero to decide whether the condition is true (if it is non-zero) or not true ( when it is zero).

You can use formulas with all operators from CAL., if you include them into ( ...).
 

In that case the condition is true, when the result is NOT zero.

 

' This will make an OR'ed decision

IVV.($$MAA<9)+($$MAB>0)

' Do something if result is NOT zero

ELS.

' Do this if result is zero.

EIF.

 

You can also use a Syntax with delimiters "|". In this case you can use formulas on both sides as you wish.

'

IVV.($$MAA*5)|>|(8*1+0.5+$$XYZ)

 


 

clip0519

 

 

How to use the SPR with "Java-type" Setup programs

 

If you see that the MEL. command does not click anything and the window-class is "Sunawt ..." you are going to automate an "Java-type" Application.

Now the first step is, use only Compatible-Engine Commands like MLC. or MLI. for clicking on Buttons.

You may need to use the "Pattern Technology" (ANA.-Command etc.) or simple Mouse-Positions to locate Buttons.

 

Second, use Window-relative coordinates to locate the buttons.

 

If you are a more experienced user, use the Quadrant coordinate System and the QFR.-command.

This will scale your clicks when the User has a larger font size.

 

Third, there will be moments when the Setup is working, and your Script has to wait.

Of course you can simply use PAU. Command. But this is not the perfect solution.

With the SPR, use RRA. and WRA. instead.

These commands will react on "changes" in the Setup-Programs windows.

This way you can see when the Setup has finished his Job.

 

Also there are quite a number of Pixel-Color Operations. You can use these to find out, if a Checkmark is set or to make more complex operations.

Also use Quadrant-Coordinates here to make things "Scale" when the User has another font-size.

To check which "DPI" is set on the local system, use IDP. and the DPI. command.

 

  See also

1.5.2 Using Variables

1.5.3 More about Variables

1.5.5 Global and Local Variables

1.5.6 Using the data stacks

1.5.7 Using Text-Strings

1.5.8 Basic String Operations

1.5.9. Organizing data items in blocks

1.6.1. Program Flow Control

1.6.2. Looping around

1.6.3 Flexible Loops

1.7. Application and PID

1.7.1 Applications and Threads

1.8. Selecting the Application (Topwindow)

1.8.1 The "Client" and the "Non-Client" Parts of a window

1.9. Locating Child-Windows