Using the TextEditor as a console. More...
| bool | openConsole(string app,string path, stringList parameter) |
| bool | exists(string app) |
| void | send(string app, string command) |
console turns the central Text Editor into a terminal for an external command-line program. You start that program only from a macro, with the static openConsole. After that, send types a line into the same console, and exists tells you whether that application is still attached. Commands can also be typed by hand in the Text Editor once the console is open. All members are static; you never construct a console object. The window that shows the output is a textEdit.
Example:
stringList args;
if (!console::openConsole("mytool", "/usr/bin", args))
return 1;
console::send("mytool", "help\n");
Starts app as a console in the central Text Editor. The executable is searched in path and in the usual system locations. parameter is the argument list passed to the process.
| Parameter: | |
|---|---|
| app | application name used as the console id |
| path | directory to search for the executable |
| parameter | command-line arguments |
Returns: true if the console was started, otherwise false.
Returns: true, if a console with the application exists.
Sends command to the console of the appllication app.
| Parameter: | |
|---|---|
| app | app |
| command | command |