Rocket Terminal Emulator

 View Only
  • 1.  Automate common workflows in BlueZone using scripting languages

    ROCKETEER
    Posted 12-09-2020 10:23
    Edited by Tommy Hueber 12-09-2020 10:25

    This article is part of the Automation and Scripting - Did you know series

    Automate common workflows in BlueZone using scripting languages

    Did you know BlueZone comes bundled with a propriety Terminal Emulator Scripting Language, and that it also supports many other languages? Being able to automate terminal session navigation with scripts will allow you to be more productive, and multi-language support makes it easy for anyone to do. The use cases are endless: simply automate keystrokes, tedious and cumbersome processes, and avoid human error and speed up processing at the same time.

    Basics of using BlueZone Script Host and Debugger

    To create and play scripts - BlueZone provides a script host application, conveniently named "BlueZone Script Host and Debugger". Open your Windows BlueZone Start Menu and simply click BlueZone Scripting Host. 

    The application is similar to Windows Script Host, but is enhanced to include a text editor, debugger tools and support for additional languages.


     The default language is BlueZone Basic, but you can select from several languages via the Options menu. Any ActiveX scripting engine can be hosted, such as JavaScript, Perl, Python, Rexx, Tcl/Tk and VBScript.

    The debugger tools include setting break points, stepping code and functions, variable viewing and evaluating expressions. In short, pretty much everything you'd expect from a development's IDE debugging functionality.

    From within the BlueZone Scripting Host you can start to create new or adjust existing scripts.

    Automation Objects

    BlueZone also includes COM objects to automate sessions and to exchange data to and from host systems.   These objects can be invoked within BlueZone Script Host scripts, from custom programs such as C# and VB.Net, or from other 3rd party integrated development environments, such as Microsoft Office Excel and Access VBA macros.

    The BlueZone objects API is simple and intuitive, for example, to launch a new BlueZone session, logon to a host system, and read text from the terminal:

     

    Sub Main

      set bzo = CreateObject("BZWhll.WhllObj")

      SessName = bzo.NewSession("myProfile.zmd")

      bzo.Connect SessName

     

      bzo.SendKey "logon username<Enter>"

      bzo.WaitReady 10, 0

      bzo.TypePassword

      bzo.SendKey "<Enter>"

      bzo.WaitReady 10, 0

     

      bzo.ReadScreen myData, Length, Row, Column

      MsgBox myData

     

    End Sub

    If you need more information there's a good chance, you'll find it in the bundled documentation.

    Using the BlueZone Script Host main menu, select "Help - BlueZone Help Topics" to display the BlueZone Advanced Automation Guide.  Chapters in the documentation include:

    • BlueZone Script Host and Debugger
    • BlueZone Host Automation Objects
    • BlueZone Basic Language
    • BlueZone Plus VBA

    BlueZone Plus VBA

    BlueZone provides an optional add-on BlueZone VBA installable software package.  When BlueZone VBA is installed, a Macros menu item is added to the session's main menu and provides access to the Microsoft VBA integrated development environment within BlueZone.  This is the same Microsoft IDE used in Excel and Access Office macros.

     

    The BlueZone automation COM objects are "built-in" when using BlueZone VBA, and accessible using the global Session variable.  All BlueZone VBA modules, classes and forms are stored in BlueZone VBA project(.BVP) files in the BlueZone\Macros folder.

    Happy scripting and please considering sharing what tasks you've been able to automate with forum members.

     



    ------------------------------
    Tommy Hueber
    Rocket Software
    ------------------------------


  • 2.  RE: Automate common workflows in BlueZone using scripting languages

    Posted 06-30-2021 10:29
    I'm trying to better understand: If an org has an enterprise license, is it still possible to get the VBA environment add-on for certain computers as needed, and what would be the cost per license for that if so? 

    Also, can the BZ VB library just be added to another app with the VBA environment?

    When trying the BZ macros, seemed really buggy and slow when running, but maybe it's because I'm not familiar with it?  Is there some place with documentation?

    ------------------------------
    Mark Farrell
    Learning Technology Team Lead
    US Postal Service
    ------------------------------



  • 3.  RE: Automate common workflows in BlueZone using scripting languages

    ROCKETEER
    Posted 07-06-2021 10:12
    Edited by David Andrews 07-06-2021 11:41
    Hi Mark,

    Please contact your Rocket Account Executive for information on product licensing and cost etc.

    Yes, you can use the BlueZone/Rocket TE objects in another VBA app, like MS Excel VBA.

    There's a small learning curve, a good reference is the Advanced Automation Guide, select Help-Help Topics in the Script Host and Debugger app. It includes chapters on the BlueZone Basic language, Host Automation Objects, and more.

    Thanks,
    Mike

    ------------------------------
    Mike Slater
    Rocket Software
    ------------------------------