Launching External Programs from Macros

You can launch external programs from eCADSTAR using system command in the macro. External programs can be launched in either a locked or unlocked state.

  • In a locked state, you cannot use the eCADSTAR application until the external program is closed, or the process is ended in Task Manager.
  • In an unlocked state, the eCADSTAR application is launched and can be used immediately.

In both the locked and unlocked states, the formatting shown below is required in the macro:

(system command:\”<Executable> <Arguments>\”.

To prevent the program opening in a locked state, the Windows start command must be called. This comprises two parameters: Start and CMD. The Start parameter has additional arguments that can be accessed by typing "start /?" into the command prompt window. The following is an example of an argument for start: /MIN. This launches the program in a minimized state.

Similar to the Start parameter, the CMD parameter also has associated arguments. These are accessed by typing "cmd /?" into the command prompt window. To avoid eCADSTAR freezing, it is recommended that the cmd /c argument is used. This executes the command, and terminates it. An example of using the Start and CMD parameters together is shown below. These should be placed before the executable within the string, as follows: “cmd /c start”.

Examples are shown below of complete strings for launching an external program within eCADSTAR.

Locked

To launch an external program in a locked state, the following format is used:

[System Command] [External Application Executable] [External Application Arguments/Parameter].

This is shown in the example below:

(system command:"\"C:\\Program Files\\Microsoft Office\\root\\Office16\\WINWORD.EXE\"/t C:\Users\User1\Desktop\test.docx").

 

Note
The Microsoft Word argument “/t” allows a specific document to be opened when this application is launched.

 

Unlocked

To launch an external program in an unlocked state, the following format is used:

[System Command] [Command Parameter] [Command Argument] [Start Parameter] [Start Argument] [External Application Executable] [External Application Arguments/Paramter].

This is shown in the example below:

(system command:"cmd /c start \"test\" \"C:\\Program Files\\Microsoft Office\\root\\Office16\\WINWORD.EXE\" "/q).

 

Note
The Microsoft Word argument “/q” launches this application without the splash screen.