<< Click to Display Table of Contents >> Navigation: 3. Script Language > Browser and Office (Acc.-Engine) > Browser and Office Commands |
MiniRobotLanguage (MRL)
LBR. Command
Launch (Mini-)Browser
Intention
This command is used to start the Mini-Browser (=MB). It can also connect to a MB that is already running.
If you use LBR. to start a new MB then you can specify startup-parameters when using LBR. to start the MB.
These include:
- the window position
- the window size
- the WEB-/Intranet-Sites to load at startup
- if the MB should automatically close at script-end or not (svf="survive father")
These features are only available when starting the MB using the LBR.-command.
To start the MB, a simple
LBR.
is all you need. If you want to specify that a site should be loaded immediately after startup, use:
LBR.site=http://www.smart-package.com
You can specify multiple sites in the same way:
LBR.site=http://www.smart-package.com|site=www.fa2.de
This will do the same:
LBR.site=http://www.smart-package.com$crlf$www.fa2.de
Then all these sites will be opened in the MB, one after the other.
Hint: To wait until the sites have been opened, use the command WBR.
You can specify a window size and position and other startup parameters, for the starting Browser-window.Like this:
' We put the Sites into a variable to have a shorter line length
' for this example.
$$SIT=Site=www.fa2.de|site=www.it-berater.org$crlf$www.facebook.com
LBR.Size=1024,980|Pos=0,0|svf=0|$$SIT
If LBR. is used in your scripts, in any way, then the EXE-Compiler will automatically include the needed Executable "SPR-Browser.exe" into the final EXE-Package. This way it can be used on any Client-PC in a consistent way.
Alternatively you can start the MB using any "EXE."-command, or have the MB been started by other applications as the registered browser.
In this case you need to take yourself care that the MB is available on the target system, and if needed, is registered as the default browser.
In this case, you can use LBR. to connect to an already running MB, no matter how it was started. For more Information about the term CUN, see ! Smart Package Robot 's InterKOM Technology.
Example:
' $$BCU holds the CUN of the MB
' That we want to connect to
LBR.connect|$$BCU
Hint:
For yet unknown reasons, the Mini-Browser may in seldom cases crash immediately
after starting. To make sure the MB is running properly, you can use this script:
' Button-Text must be changed for other then german language.
DBC.a|§§A00|SPR-Browser|&Programm schließen|||2|#32770
DBC.a|§§A01|SPR-Browser|Abbrechen|||2|#32770
$$URL=www.bitcoin.fa2.de
:retry
LBR.site=$$URL|Size=1024,980|Pos=2820,0|svf=0
' Here comes the trick, we first get the Window handle
' that is zero in case of a crash
CBR.gw.
HTV.$$WND
IVV.$$WND=0
' Now we shoot the MB
KPN.SPR-Browser.exe
PAU.200|ms
GTO.retry
EIF.
For more details on the Mini-Browser (MB) see there.
Syntax
LBR.[P1][|P2...|Px]
Parameter Explanation
P1...Px - (optional) If no Parameter is given, MB will launch with its default site.
that is: "about:blank". Otherwise you can specify the following
startup-parameters:
"connect=" - this Subcommand is special, because it can not be combined with
any other Subcommand.
It does not start a new MB, but tries to connect the Script to an existing MB,
which CUN is in the given Variable.
If CUN is zero, it tries to get the CUN of the last localized Window.
Example:
LBR.connect=$$BCU
"size=" - this Subcommand can be used to give the new starting MB a defined
Window-Size. Example:
LBR.Size=1024,800
You can just omit coordinates, then they will be
replaced with default coordinates.
"Pos=" - this Subcommand can be used to give the new starting MB a defined
Window-Position. While you can give screen coordinates
as parameters, you can also write this:
' Center the MB
LBR.Pos=mid
' Place the MB at the given Coords
LBR.Pos=1200,900
You can just omit coordinates, then they will be
replaced with default coordinates.
"Svf=" - this Subcommand means "Survive Father". It can be used to define a
behavior for the new starting MB. If set to "0" then the MB will automatically
close, when the robot / script ends.
If set to"1", then the MB will survive the "end of script". Example:
LBR.Svf=1
"Site=" - this Subcommand defines the sites that will be opened, immediately when
the MB starts up.
You can give multiple "SIte=..." Subcommands. Also you can give a variable,
in which the names of the sites to be opened are delimited by $crlf$.
Example:
LBR.Site=www.fa2.de
LBR.Site=www.fa2.de|site=www.it-berater.org
Example:
LBR.Size=1024,800|Pos=40,0|svf=0|Site=www.fa2.de
Example
'**********************************************
' LBR. - Sample
'**********************************************
$$SIT=Site=www.fa2.de|site=www.it-berater.org$crlf$www.facebook.com
LBR.Size=1024,980|Pos=0,0|svf=0|$$SIT
WBR.
CBR.select|2
CBR.goto|www.theogott.de
WBR.
CBR.CloseT|face
PAU.20
ENR.
'**********************************************
' LBR.connect - Sample
'**********************************************
EXE.SPR-Browser.exe www.fa2.de
PAU.2
STW.t|SPR Mini
GIK.cfh.||$$BCU
LBR.connect=$$BCU
DOL.
DBP.$mb_ert$
DBP.#mb_busy#-#mb_prog#
OOP.(0)
MBX.Ready
ENR.
Remarks
There are multiple examples on using the Mini-Browser within the supplied Sample Scripts. A list with possible Errors can be found here:
Internet Explorer Errors and here: HTTP-Status Codes
Limitations:
-
See also:
• ! Smart Package Robot 's Browser and Office Commands
• LBR. - Launch (Mini-)Browser
•