Special Host-To-Mac Commands
Note: Also see...
MacWise and AppleScript
Saving and Restoring Screens
Accuterm Supported Escape Sequences
Kermit and MacWise
Host Sample Programs
Host to Mac and Mac to Host File Transfers
System Builder Supported Escape Sequences
MacWise™ is capable of processing special codes from the host which control features of the program beyond normal terminal emulation. By programming these codes into a host BASIC program you can instruct MacWise™ to perform the following client/server actions
ESC ~ 1
Mouse click sends its cursor position to host preceded by ESC MOUSE
(CCC,RR where C=Column and R=Row)
Mouse is clicked on column 5 row 20
MacWise sends ESC MOUSE 005,20 CR
(where ESC = ASCII decimal 27 and CR = ASCII decimal 13)
ESC ~ 2
Mouse click has no effect
ESC ~ 3
ESC ~ 4
ESC ~ 5
Make a new capture file. (Allows operator to make a new capture file. Responds with carriage return if new file created, else responds with "Canceled")
Make a new capture file and supply the Mac file name *
This is a Forced mode and there is no operator intervention. Data is saved to disk and MacWise™ responds with "Capture Off" when ESC~4 is sent.
Same as ESC~5~F above, except that data is not sent to screen (Transparent mode) * Data is saved to disk and MacWise™ does not respond with "Capture Off" when ESC~4 is sent.
Make a new capture file and supply the Mac file name *
Allows operator Intervention. Operator can change the file name or Cancel the file transfer. MacWise™ responds with "Canceled" if the operator cancels the transfer.
Data is saved to disk and MacWise™ responds with "Capture Off" when ESC~4 is sent.
Same as ESC~5~I above, except that data is not sent to screen (Transparent mode) *
Data is saved to disk and MacWise™ does not respond with "Capture Off" when ESC~4 is sent.
ESC ~ 6
Request name of current capture file (responds with name)
ESC ~ 7
Select a new capture file for append (Allows operator to select a new file. Responds with carriage return if file selected, else responds with "Canceled")
ESC ~ 8
ESC ~ 9
ESC ~ A
Request MacWise ID (responds with "MacWise")
ESC ~ B
Caps lock on
ESC ~ C
Caps lock off
ESC ~ cx (where x = 1 or 0 to enable or disable Option c )
Enable or disable Option c to close the connection
ESC ~ D
Clear entire screen
ESC ~ E
Clear Message (rows 25 & 26)
ESC ~ F
Clear FKey Display (rows 27 & 28)
ESC ~ G Command
Host-To-Mac Transfer with command or Proc name. *
Example: PRINT CHAR(27):"~G":"LIST-CUSTOMERS.5" sends the correct escape sequence followed by the Proc name (LIST-CUSTOMERS.5) and a carriage return.
Reset capture file back to original name (recorder)
Abort from Mac-To-Host data transfer
Send a file from the Mac to the Host computer and let the user select the file.
ESC ~ a~Filename
Run an AppleScript
Running AppleScripts from a Host Basic Program
You can send an escape sequence from the host computer to run an AppleScript.
A compiled AppleScript must be in the AppleScripts folder inside of the MacWise app in MacWise/Contents/Resources/AppleScripts
The sequence is "ESC tilde a tilde AppleScriptName.app"
The following example shows how to do it from a host Basic program:
PRINT CHAR(27):"~a~Carnation Time Zone.app"
Send a file from the Mac to the Host computer and uses MacFilename
(Assumes that that MacFilename is on the desktop starting with MacWise 15.4.2)
MacWise sends "Canceled" if the file is not found.
These also work with MacWise 15.4.2 or later
Displays a dialog box with the message. *
Print the screen
ESC CTRL B < URL CR
Launches your browser and goes to the URL provided by the host *
Can also launch files on your Mac
Example host program:
NOTE: If the URL does not contain http or mailto, then MacWise attempts to open a document on your Mac. For instance...
PRINT CHAR(27):CHAR(2):"<":"MyFilename" (no path is supplied here so the file would need to be on the desktop.
With MacWise 14.0 or later, if you use "BootVolume" as the MyDrive Name, MacWise will automatically use the name of your Mac drive.
With MacWise 14.0 or later, if you use "UserDesktop" as the MyDrive Name, MacWise will look for the file on the Desktop.
With MacWise 14.0 or later, you can use DOS file names like this...
With MacWise 14.0 or later, slashes are no longer allowed in the file name
NOTE 2: There are no error messages generated if the host has supplied an incorrect command for the URL or file.
ESC CTRL B > URL CR
Same as above
ESC STX D p o m ; path CR
Download file from host to PC. Protocol p may be A (ASCII),
K (Kermit), X (Xmodem), Y (Ymodem) or Z (Zmodem);
Overwrite o may be O (overwrite) or N (no overwrite) or, if
protocol is Z, overwrite may be R (); Mode m may be T (text)
or B (binary). Path is the drive, directory and file name of
the file being received. When using Kermit, Ymodem or
Zmodem protocols, only drive and directory need be
specified, as the file name is included in the transfer protocol;
however if the file name is specified here, it overrides the file
name included in the transfer protocol.
ESC STX S Returns status of last file transfer. Status message is:
Status: s f i l es f bytes b CR
where f is the number of files transferred, b is the number of
bytes transferred, and s is the transfer status:
0 = transfer successful
1 = unable to open file
2 = transfer aborted by operator
3 = file already exists
4 = terminated due to timeout
5 = terminated due to corrupted data
6 = invalid packet type
7 = terminated by remote program
8 = 8 data bits required for protocol
9 = software flow control not allowed for protocol
ESC STX C o p ; path CR
Begin capture. Mode o may be O (overwrite), A (append), N
(new file only) or C (clipboard). Source p may be P to
capture printed data or null to capture received data. Path is
the drive, directory and file name where the captured data is
to be stored. All characters received (or printed) are stored in
the file (or clipboard) until capturing is disabled (via local or
remote command). Note: when capturing to the clipboard,
path is ignored).
NOTE: the clipboard is not currently supported with this command.
ESC ~8 and ESC ~9 instead.
ESC STX C X
End capture. The file containing the captured data is closed.
ESC = CHAR(27)
Example: PRINT CHAR(27):"~D" Clears the entire screen.
STX = CHAR(02)
~ (Tilde) = CHAR(126)
* This escape sequence must end with a carriage return.