Execute
This method allows you to execute any command from within a script.
It takes a ExecuteArgs as the only parameter
ExecuteArgs
| Name | Description | Type | Example |
|---|---|---|---|
| command | The name of the command to execute | string | ffmpeg |
| arguments | The arguments to pass to the command | string | -i file.mkv -o out.mp4 |
| argumentList | Same as arguments but a string array | string[] | ['-i', 'file.mkv', '-o', 'out.mp4'] |
| timeout | Optional: The timeout of this command in seconds | number | 30 |
| workingDirectory | Optional: The working directory to execute the command in | string | /media/my/folder |
info
Only use one of arguments and argumentList, do not use both
ExecuteArgs C# Object
If you wish to use the strongly typed ExecuteArgs objects, you need to use TitleCasing and you have more properties.
| Name | Description | Type | Example |
|---|---|---|---|
| Command | The name of the command to execute | string | ffmpeg |
| Arguments | The arguments to pass to the command | string | -i file.mkv -o out.mp4 |
| ArgumentList | Same as arguments but a string array | string[] | ['-i', 'file.mkv', '-o', 'out.mp4'] |
| Timeout | Optional: The timeout of this command in seconds | number | 30 |
| WorkingDirectory | Optional: The working directory to execute the command in | string | /media/my/folder |
| add_Output | Function with single parameter of each output line as it is received | function | function(string line) |
| add_Error | Function with single parameter of each error line as it is received | function | function(string line) |