X3270PORT environment variable

The  environment variable contains a TCP port number used by a script to pass actions to the emulator. Scripts are run by the Script action. The emulator listens to that port on the IPv4 loopback address,. The script uses the s3270 protocol to communicate with the emulator.

Examples
The port is a randomly-chosen ephemeral port number. 12345