Run

Top  Previous  Next

Description


The Run command launches a user-specified external application. For more information on using FreeFlyer with other applications, see the Interfacing with External Resources Guide.

 

 

Syntax


Run "myApplication.exe myFile.txt";
Run "notepad.exe myFile.txt" with wait;
Run "notepad.exe myFile.txt" without wait;
 

// Specify the full path to an executable that is not in the Windows System Path
Run '"C:\Program Files\Windows NT\Accessories\wordpad.exe" "..\My Folder\myFile.txt"' without wait;
Run '"C:\Program Files\a.i. solutions, Inc\FreeFlyer 6.6.1.10321\FreeFlyer.exe" -mp myMP.MissionPlan' without wait;

 

// Handle a quotation mark in a file path

Run 'notepad.exe "D:\Joe' + "'" + 's Folder\myFile.txt"' without wait;

 

// Execute a command from the Command Prompt

Run "cmd.exe /c mkdir newDirectory";           // Make a new directory

Run "cmd.exe /c ren myFile.txt myNewFile.txt"; // Rename a file

 

Where:

myApplication.exe is an external program (.exe, .cmd, .bat, .com)

myFile.txt is any text specifying a valid path and filename, including extension

 

Note: Using "/c" is required to automatically execute a command from the Windows Command Prompt within a Mission Plan.

 

 

Details


Using the optional "with wait" clause, FreeFlyer is paused until the external application is closed.

Using the optional "without wait" clause, FreeFlyer continues after the external application has been successfully launched. The default behavior is "without wait".

 

If there are spaces in a file path, such as the path that specifies the external application, single quotes should be used around the combined path and argument(s), and double quotes should be used around the path, as shown in the examples above.

oIf there is a quotation mark in the path to the file, the syntax shown in the final example above can be used to manually concatenate strings.

 

It is not necessary to specify the full path to an executable if it is located in the Windows System Path, as shown above in the Notepad examples.

oOtherwise, a full or relative path must be specified. Relative file paths are specified relative to the location of the .MissionPlan file.

 

The Run command can open additional instances of FreeFlyer, as shown above. For more information about sending arguments to FreeFlyer, see the Command Line Reference.

If FreeFlyer is unable to launch the external program, an error is returned.

 

By default, FreeFlyer keeps all report files open during the execution of a Mission Plan.

oTo force FreeFlyer to close an open report, you can use the Close command to close the file associated with a ReportInterface.

oIf a file is not explicitly closed before being used by another program, then there is no guarantee that all data will be present in the file.

If a Mission Plan generates a report file, and at the end of the Mission Plan, the newly generated report file is processed by another application via the Run command, you should close the file before calling the Run command. Otherwise, you are not guaranteed to have all the data in the file when the Run command is executed.

 

 

Command Editor


Enter program and arguments explicitly

Program to run

Arguments

 

Use String containing program and arguments

Specify a String object containing the program to run and any input arguments

 

Wait for execution to finish

FreeFlyer is paused until the external application is closed

 

Don't wait for execution to finish

FreeFlyer continues after the external application has been successfully launched

This is the default behavior

 

Script

Displays the FreeFlyer Script that is generated by the editor

 

Description

Displays descriptions of the editor and its fields

Description text changes as the mouse pointer moves over the different fields within the editor

 

 

 

See Also


Interfacing with External Resources Guide