Tools: MPW
Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Support

MPW Command Reference


RProj

Built-in

SYNTAX

RProj command

DESCRIPTION

The RProj command allows you to send a single Projector command to the SourceServer application. SourceServer is a single-user Projector server that is designed to be used in conjunction with a shell application. The RProj command can be used from either the MPW Shell or from ToolServer.

If you want to offload time-consuming Projector scripts, you can use RProj with the MPW Shell and RShell to package Projector scripts and send them to ToolServer, which then processes the scripts and sends one RProj command at a time to SourceServer. (See the RShell command.)

If SourceServer is not running when the RProj command is executed, the MPW Shell launches it.

INPUT

Does not accept standard input.

OUTPUT

Standard output.

STATUS

RProj can return the following status codes:

0

no errors

1

syntax error

2

execution error; invalid input

3

system error

-1

unknown command

PARAMETERS

command

An MPW command line containing a single, atomic, Projector command.

Options to Projector commands must be listed explicitly, and pathnames must be fully expanded. SourceServer cannot expand MPW Shell variables or command aliases.

OPTIONS

None

EXAMPLES

Scripts designed to run on a ToolServer and SourceServer combination could contain lines such as

RProj MountProject "{MPW}Examples:Projector Examples:Sample:"

Note that in this command line the Shell variable {MPW} is expanded by the shell application before the RProj command sends the command line to SourceServer.

To send a preexisting script of Projector commands to SourceServer, you must first use the Alias command to insert an RProj command before each of the Projector command lines. For instance, for a MountProject command, the Alias command line appears in the following form:

Alias MountProject "RProj MountProject"

After executing the Alias command, you could use the MountProject command alias without further modification:

MountProject "{MPW}Examples:Projector Examples:Sample:"

There are two scripts with a master list of command aliases provided with SourceServer: AliasSourceServer and UnaliasSourceServer. To give the command aliases a scope beyond the execution lifetime of the AliasSourceServer script you must use this command line:

Execute AliasSourceServer

It is frequently desirable for the current directories of both ToolServer and SourceServer to refer to the same directory so that existing Projector scripts can be run without modification. This is necessary when, for instance, you use SourceServer to check out files and ToolServer to build files.

AliasSourceServer changes the MPW Directory command to the command alias Directory2. The Directory2 script changes both the ToolServer and SourceServer current directories simultaneously. The AliasSourceServer script calls Directory2 with no arguments to discover the working directory of ToolServer and then sets SourceServer to the same directory. As a result, Projector commands performed by SourceServer, as well as non-Projector commands performed by ToolServer, operate on the same default directory.

Once the directories of SourceServer and ToolServer are synchronized, you can issue Projector commands and route them to SourceServer with no further modification.

Execution of the UnaliasSourceServer script restores ToolServer to normal operation. An entire script for the ToolServer and SourceServer combination might look as follows:

Execute AliasSourceServer
MountProject "{MPW}Examples:Projector Examples:Sample:"
Checkout -project Sample -d "{MPW}" "command pages"
Execute UnaliasSourceServer

Assuming that the ToolServer and SourceServer combination is running on a different computer than your primary machine and MPW Shell, you can use the RShell command to send the script via Apple events. First, save the following script in a file named, for example, MyProjectorCommands:

Execute AliasSourceServer
Directory RemoteMachine:MySourceDirectory:
MountProject AnotherMachine:MyProjectDirectory:
CheckOutDir -r RemoteMachine:MySourceDirectory:
CheckOut -touchOnly -p MyNameRevision -r
Execute UnaliasSourceServer

Then type

RShell 'Execute RemoteMachine:MyProjectorCommands' ∑∑ "{MPW}"WorksheetTS

and press Enter. The MPW Shell displays a PPC Browser that allows you to select the target machine and application for the RShell command. (See the RShell Examples.) When you select the remote ToolServer, RShell tells it to execute the script MyProjectorCommands. When ToolServer executes the commands (which were aliased to include RProj before each one) RProj sends one command at a time to SourceServer. SourceServer executes the command and sends its results back to ToolServer.

SEE ALSO

RShell

 
 


Last Updated July 2000