Class ShellScript
Properties
Optionalstandard Error
standardError?: string
Content sent to standard error during the execution of the script
Optionalstandard Output
standardOutput?: string
Content sent to standard output during the execution of the script
Methods
execute
Executes the shell script.
Parameters
- arguments: string[]
An array of string arguments to pass to the script. These will appear to the script as command line arguments would.
Returns boolean
trueif the script was executed without error,falseif not.- arguments: string[]
Staticcreate
Convenience method to create a ShellScript object.
Parameters
- script: string
A string containing the shell script. This should contain the appropriate "she bang" to trigger the appropriate scripting language/shell.
Returns ShellScript
- script: string

ShellScript objects can be used to execute Unix shell scripts.
Bash Example
Ruby Example
Note: When executed, scripts are saved to temporary files in the Drafts' script directory at
~/Library/Application Scripts/com.agiletortoise.Drafts-OSXand run. Scripts should not be written to make assumptions about their location in the file system (e.g. using relative paths). The first time a script is executed, the user will be asked to grant permissions to the script directory.