![]() |
![]() |
![]() |
|
![]() | |
![]() |
![]() |
![]() |
![]() |
![]() |
Log In | Not a Member? |
Support
![]() |
![]() |
SYNTAX Execute command [parameters] or command [parameters] [-background] [-print] [-quit] [-wait] DESCRIPTION There are two ways to run a script, built-in command, tool, or application from MPW: • If the Execute command is used, the program is executed in the current scope. If you use the Execute command to run a script, any variable definitions, exports, or aliases in the script continue to exist after execution. When running a script file, Execute ignores any subsequent parameters on the command line, however, parameters within a script file are available to the enclosed script. Built-in commands, tools, or applications execute as if the Execute command is not there. Unlike its behavior with script files, Execute accepts parameters to these items. • If the program name is not preceded by the Execute command, the program is launched in the foreground with its own scope. If the program is already running, it is brought to the foreground. If you run a script in this manner, any variable definitions, exports, or aliases in the script are local to the script. If additional parameters are specified on the command line, they are passed along to the program. If you run an application in this manner, any files listed on the command line will be opened by the application if it is capable of opening them. In addition, there are four options that can be used to control the execution of applications. INPUT None OUTPUT None STATUS Returns the status of the last command executed. PARAMETERS command Specifies either a script file, built-in command, tool, or application to be executed. OPTIONS The following options are available when running an application without using the Execute command. Note that these options are not available when running scripts, built-in commands, or tools, or when using the Execute command. -background Launches the application in the background. Causes any files listed on the command line to be printed instead of opened. -quit Causes an application that is already running to quit. -wait Delays resumption of Shell commands until the application has quit. EXAMPLES The following command line executes the UserStartup•Mine script. Execute "{ShellDirectory}"UserStartup•Mine You can use this, for example, to test any changes you have made to the UserStartup•Mine script. Variable definitions, exports, and aliases set in this script remain available after execution of all commands. In the following example, the -wait option is specified when launching the application MyApp. This ensures that the Beep command will not be executed until MyApp has quit. MyApp -wait; Beep
|