The com.sabre.redapp.example.scribe sample includes the following functionality:
Sabre Scribe scripts that you can run in Sabre Red 360:
READWRITEEXAMPLE. This script demonstrates the ability to read from a file and write to a file within a plug-in. As its description on the Open SabreScript dialog says, this script copies the first 10 characters of the
sample.txtfile that is included in the plug-in, and writes these characters to
test.txtin the workspace in the following path:
SAMPLESCRIPT. This sample script displays "Hello World." When you run this script, a hidden script called
HelperScriptis run automatically and a dialog is displayed for demonstration purposes.
Active listening for commands to invoke Sabre Scribe scripts
This sample registers the EMU_COMMAND service in
redapp.xml to integrate active listening for host commands that start with 1LAS. When the Sabre Scribe listening service detects a command that begins with
SAMPLESCRIPT is executed from the plug-in. After dismissing the dialog,
HELPERSCRIPT displays a dialog to inform you that a hidden script is invoked.
|If you add the Sabre Scribe sample plug-in with other sample plug-ins that use emulator commands to your run configuration, the active listening feature catches commands that begin with 1LAS, runs a script, and then sends the command to the host. Active listening in the Sabre Scribe sample may interfere with other samples that you are using, so you may want to add the Sabre Scribe sample to your run configuration separately.
Running the Sample
In Eclipse, import the com.sabre.redapp.example.scribe plug-in into your workspace and add it to your run configuration.
Launch Sabre Red 360 from your run configuration, and log in with your CERT Sabre ID.
Active Listening for Commands
Open a Sabre work area, and log in to Sabre emulator with your CERT Sabre credentials.
Send a host command that begins with 1LAS. SAMPLESCRIPT is executed.
After you dismiss the dialog, another dialog denotes that a hidden script is executed. After you dismiss that dialog, the emulator sends your command and displays the response.
If multiple scripts register the same command, the Conflict Resolution dialog is displayed in Sabre Red 360. You must choose the script (or service) that you want to invoke.
Running Sabre Scribe Scripts
On the Tools menu, choose Scribe Scripts.
When the Open SabreScript dialog is displayed, choose a script to run and click OK.