How to record a login macro and automatically run at startup

How to record a login macro and automatically run at startup

Running a simple script that logs into the host is a common request, which is easily accomplished following the steps below:

Record a Macro:

  1. Open the FlexTerm workspace, which contains the session that you want to automatically login to.
  2. Make sure the session is connected to the host, otherwise select the Home ribbon tab and press the Connect button in the Communication tab group.
  3. From the Macro tab group, press the Record button to begin recording your keystrokes, mouse movements, etc.  Since everything is recorded until the Record button is pressed a second time, caution should be used during this step of the process.
  4. Login to the host as you would normally.
  5. Optionally, issue any commands necessary to reach your final destination.  For example, if you want to land on a particular menu option of the host application, record the necessary keystrokes.
  6. Once you are satisfied with the macro recording, press the Record button to end recording, which will prompt you for a name for the macro.
  7. Enter a new name in the File name field, or optionally select an existing macro to overwrite, then press the Save button.

Configure Session to Run the Macro at Startup:

  1. Logout of and disconnect from the host using the Connect button in the Communication tab group on the Home ribbon tab.
  2. Press the Setup button in the Communication tab group.
  3. Expand the Advanced section by pressing the arrow to the left.
  4. Press the ellipses button  to the right of the Start Up Action property.
  5. Select Macro from the Action Property page.
  6. Select the macro recorded earlier from the list and press OK twice.
  7. Choose the File>Save All menu command to ensure all settings are saved.
  8. Test by reconnecting the session using the Connect button in the Communication tab group.

Notes:

  • If the recorded macro does not work as expected, you may simply re-record, or manually edit to fix any obvious errors.
  • Text entered into password fields are recorded as encrypted text, which is then decrypted during playback.
  • To remove the startup macro from a session, simply set the Action Property to Nothing

    • Related Articles

    • How to assign a macro to a keystroke

      A user may wish to assign a macro that was previously recorded or written to a key combination on the FlexTerm keyboard map. Use the steps below to accomplish this: Open the FlexTerm session (*.aha) to be modified. Select the Schemes menu. Press the ...
    • How to export a host screen to Microsoft Word

      A macro can be used to "scrape" the data from the current FlexTerm host screen and export to a Word document.  The sample macro code below demonstrates this: Sample Code: Sub Main() ' Create the Word objects Set objWord = ...
    • How to export a host screen to a new Outlook email message

      A macro can be used to "scrape" the data from the current FlexTerm host screen and export to a newly created Outlook email message.  The sample macro code below demonstrates this: Sample Code: Sub Main()   Dim outobj, mailobj  ' Determine the actual ...
    • How to export data from several host screens to cells in an Excel spreadsheet

      A macro can be used to "scrape" specific table data from the current FlexTerm host screen, export to cells within a newly created Excel spreadsheet, then repeat this process to traverse multiple host screens.  The sample macro code below demonstrates ...
    • How to apply or update the FlexTerm license key

      The license key can be applied or updated thru the FlexTerm Workspace or via the FlexLicense.exe application from the FlexTerm installation directory. Updating thru the FlexTerm Workspace: Open the FlexTerm Workspace. Choose the File>About menu ...