Tera Term Macro Examples

The terminal emulation program Tara Term is an easy-to-use terminal emulator, similar in function to HyperTerminal or Procomm. But, Raveon finds it is easier to use, more reliable, and has better features. One of its new features is the ability to process a “Macro File”. It is a very handy program to communicate with a Raveon data radio modem, and is a good way to automate the configuing your radio modem.

SourceForgeJP Find Software Tera Term Download Tera Term Lists Ticket Docs Summary N Source C Wiki Tera Tenn is Tera Term Pro 2.3 succession version and is being officially recognized by the original author Tera Tenn is open source free software terminal emulator supporting SSH2 and UTF - 8 protocol. MACRO (TTPMACRO.EXE) is an interpreter of the macro language 'Tera Term Language (TTL)', which controls Tera Term and provides various functions like auto dialing, auto login and so on. Usage How to run a macro. Tera Term Macro language file for GeSHi. This version of ttl.php was created for Tera Term 4.60 and LogMeTT 2.9.4. Newer versions of these application can contain additional Macro commands and/or keywords that are not listed here. The latest release of ttl.php can be downloaded from Download section of LogMeTT.com. I know Tera Term has a site that lists example macros as well as a command list but I guess what I need is someone with experience scripting in Tera Term. Tera Term uses a sort of Basic language called Tera Term Language (TTL) but I found it hard from the site to actually identify which commands I needed to use.

Tera Term is an open-source terminal emulation program that is easy to use, and very powerful. Raveon recommends using it over Hyperterminal. Version 4.7 is currently available for download at logmett.com here: http://logmett.com/index.php?/download/download-tera-term-470-freeware.html Tera Term has a Macro FIle script processor that allows a person to create a script file of macro commands. The Script file can configure the radio modem, prompt the user for input, and validate the programming of the radio modem.

Tera Term Macro files have an extension .TTL. When in install Tera Term, the .TTL extension will be associated with Tera Term, so anytime you click on a .TTL file, the Tera Term maco processor should run it. If it does not, you can manually associate the “TLL” file as described below.

The macro File with the .TTL extension must be created before you can run it. Raveon may provide this for you, or you may create this yourself. Information about Tera Term’s Macro abilities is here:http://ttssh2.sourceforge.jp/manual/en/macro/ although you may have to search the Internet for more details. A good way to understand it, is to study a macro file provided by Raveon.

When you run a macro file, there will be at least two windows pop-up, and maybe three windows. The largest window is the Tera Term program itself. As the macro runs, there will be a small window titled MACRO – xxxxx where xxxxx is the name of the macro file that is running. You can pause or end the macro execution by clicking on a button on this window.

Tera Term Macro Examples

At various plces in the macro file script, the user may be promoted to enter a paramter, or answer yes/no to a question. A good practice at the end of the script is have the macro script close Tera Term so another script may be started.

How to associate “TTL” files with MACRO

Since Tera Term 4.59, you can associate “.TTL” files with MACRO with installer. To associate the file extension “.TTL” with MACRO, do the following steps.

File
  1. Execute the [View] Options command of Explorer.
  2. Select the “File Types” tab.
  3. Click the “New Type” button and specify items like the following.
  4. Click the “New” button and specify items like the following.
  5. Close all the dialog boxes by clicking “OK” buttons.

Macro Example

Below is a simple example macro script to program a Raveon M7 radio modem.

Following is a quick overview of the Tera Term Macro Language.

Identifiers and reserved words

1) Variable identifiers

The first character must be an alphabetic (A-Z, a-z) or an underscore character '_'. Subsequent characters can be alphabetic, underscore or numeric (0-9). Variable identifiers are not case sensitive. The maximum length is 32.

Tera Term Macro Examples

2) Label identifiers

Label identifiers consist of alphabetic, underscore or numeric characters, and are not case sensitive. The maximum length is 32.

3) Reserved words

The following words are reserved:

Line formats

There are four kinds of line formats for macro files. Any line can contain a comment which begins with a ';' character. Also, a user can use the C language style comment(/* - */).
Comments give no effect on the execution of MACRO.
One line can contain up to 500 characters. The part that exceeded 500 characters is ignored.

1) Empty lines

Lines which have no character or contain only space or tab characters or a comment. They give no effect on the execution of the macro.

2) Command lines

Lines containing a single command with parameters.

Tera term macro examples ap

3) Assignment lines

Lines which contain an assignment statement.

4) Label lines

Lines which begin with a ':' character followed by a label identifier.

Tera

Communication commands

  • bplusrecv
  • bplussend
  • callmenu (version 4.56 or later)
  • changedir
  • clearscreen
  • closett
  • connect
  • cygconnect (version 4.57 or later)
  • disconnect
  • dispstr (version 4.67 or later)
  • enablekeyb
  • flushrecv
  • gethostname (version 4.61 or later)
  • gettitle
  • kmtfinish
  • kmtget
  • kmtrecv
  • kmtsend
  • loadkeymap
  • logclose
  • logopen
  • logpause
  • logstart
  • logwrite
  • quickvanrecv
  • quickvansend
  • recvln
  • restoresetup
  • scprecv (version 4.57 or later)
  • scpsend (version 4.57 or later)
  • send
  • sendbreak
  • sendbroadcast (version 4.62 or later)
  • sendfile
  • sendkcode
  • sendln
  • sendlnbroadcast (version 4.62 or later)
  • sendmulticast (version 4.62 or later)
  • setbaud (version 4.58 or later)
  • setdebug (version 4.64 or later)
  • setdtr (version 4.59 or later)
  • setecho
  • setmulticastname (version 4.62 or later)
  • setrts (version 4.59 or later)
  • setsync
  • settitle
  • showtt
  • testlink
  • unlink
  • wait
  • wait4all (version 4.63 or later)
  • waitevent
  • waitln
  • waitn (version 4.62 or later)
  • waitrecv
  • waitregex (version 4.21 or later)
  • xmodemrecv
  • xmodemsend
  • ymodemrecv (version 4.66 or later)
  • ymodemsend (version 4.66 or later)
  • zmodemrecv
  • zmodemsend

Control commands

Tera Term Macro Examples Science

  • break (version 4.53 or later)
  • call
  • do, loop (version 4.56 or later)
  • end
  • execcmnd
  • exit
  • for, next
  • goto
  • if, then, elseif, else, endif
  • include
  • mpause (version 4.27 or later)
  • pause
  • return
  • until, enduntil (version 4.56 or later)
  • while, endwhile

String operation commands

  • code2str
  • expandenv (version 4.71 or later)
  • int2str
  • sprintf (version 4.52 or later)
  • sprintf2 (version 4.62 or later)
  • str2code
  • str2int
  • strcompare
  • strconcat
  • strcopy
  • strinsert (version 4.67 or later)
  • strjoin (version 4.67 or later)
  • strlen
  • strmatch (version 4.59 or later)
  • strremove (version 4.67 or later)
  • strreplace (version 4.67 or later)
  • strscan
  • strspecial (version 4.67 or later)
  • strsplit (version 4.67 or later)
  • strtrim (version 4.67 or later)
  • tolower (version 4.53 or later)
  • toupper (version 4.53 or later)

File operation commands

Tera Term Macro Examples Geometry

  • basename (version 4.69 or later)
  • dirname (version 4.69 or later)
  • fileclose
  • fileconcat
  • filecopy
  • filecreate
  • filedelete
  • filemarkptr
  • fileopen
  • filereadln
  • fileread (version 4.48 or later)
  • filerename
  • filesearch
  • fileseek
  • fileseekback
  • filestat (version 4.66 or later)
  • filestrseek
  • filestrseek2
  • filetruncate (version 4.67 or later)
  • filewrite
  • filewriteln
  • findfirst, findnext, findclose
  • foldercreate (version 4.69 or later)
  • folderdelete (version 4.69 or later)
  • foldersearch (version 4.69 or later)
  • getdir
  • getfileattr (version 4.69 or later)
  • makepath
  • setdir
  • setfileattr (version 4.69 or later)

Password commands

  • delpassword
  • getpassword
  • passwordbox

Miscellaneous commands

  • beep
  • closesbox
  • clipb2var (version 4.46 or later)
  • crc32 (version 4.60 or later)
  • crc32file (version 4.60 or later)
  • exec
  • filenamebox (version 4.54 or later)
  • getdate
  • getenv
  • gettime
  • getttdir (version 4.60 or later)
  • getver (version 4.58 or later)
  • ifdefined (version 4.46 or later)
  • inputbox
  • messagebox
  • random (version 4.27 or later)
  • rotateleft (version 4.54 or later)
  • rotateright (version 4.54 or later)
  • setdate
  • setdlgpos
  • setenv (version 4.54 or later)
  • setexitcode
  • settime
  • show
  • statusbox
  • var2clipb (version 4.46 or later)
  • yesnobox

PAUSE 1