You may specify parameters on the Phantom command line to automatically initiate script execution or recording. In addition, you may specify that the Phantom control panel is to be hidden. Hiding the Phantom control panel can make Phantom script execution appear more like a "normal" Windows program and, if used with recording, allows surreptitious recording of user activity since no indication is provided that recording is in progress.The command line used to start the Phantom control panel or a Phantom-generated executable can be obtained from the CommandLine intrinsic variable.
The Phantom command line has the following syntax:
The WAIT, PLAY, RECORD, and HIDE keywords are not case sensitive. If neither PLAY or RECORD is included in the command line, PLAY is assumed. If PLAY is not included on the command line, Phantom will terminate when the script is finished even if the script does not contain an ExitPhantom statement. Otherwise, the Phantom control panel remains active after script execution is complete.Phantom [WAIT[=SeqId]] [PLAY] [HIDE] scriptfile [label]
Phantom RECORD [HIDE] scriptfile
The WAIT keyword directs Phantom to delay execution of the specified script until any other Phantom session started with the WAIT keyword has terminated. If the optional SeqId argument is supplied with the WAIT keyword, Phantom waits until any script for which the same SeqId was specified has terminated before initiating script execution. SeqId can be any alphanumeric string. Any number of Phantom instances may be started using the WAIT keyword. The order in which they will execute is, however, unpredictable. All that is guaranteed is that only one script will execute at a time. Note that the currently executing Phantom instance, if started with the WAIT keyword, mustterminate to allow any waiting scripts to begin execution.
Note that if you specify RECORD and HIDE, Phantom recording cannot be terminated using the Phantom control panel since it is not visible on the desktop. Also, Ctrl-Esc and Ctrl-Alt-Del cannot be used to stop recording as is normally the case. The only way to stop recording is to log out, shutdown Windows, or stop the Phantom process using the Windows Task Manager.
You can use automatically executed scripts to set up Universal variables and perform initialization for other scripts or to make Phantom act like a normal application.
If the script ends with an ExitPhantom statement, Phantom will terminate when script execution is complete.
Example
1. Phantom play script.txt
2. Phantom play hide script.txt begin
3. Phantom record hide spydata.txtNumber 1 executes the script script.txt. The Phantom control panel is minimized during script execution.
Number 2 executes the script script.txt starting at the global label begin. The Phantom control panel is hidden during script execution.
Number 3 initiates recording of keystrokes to the file spydata.txt. The Phantom control panel is hidden.