Action

ShellScript: Bash Example

Posted by agiletortoise, Last update 5 months ago

Run simple bash shell script via script. Mac only.

Steps

  • script (macOS only)

    let script = `#!/bin/bash
    echo "Total arguments : $#"
    echo "1st Argument = $1"
    echo "2nd argument = $2"
    `;
    let runner = ShellScript.create(script);
    
    if (runner.execute(["1", "2"])) {
    	alert("STDOUT: " + runner.standardOutput);
    }
    else {
    	alert("STDERR: " + runner.standardError);
    }
  • prompt (iOS only)

    promptKey
    prompt
    promptTitle
    iOS not supported
    promptMessage
    This action demonstrates features only available on the Mac version of Drafts.
    promptButtons
    OK
    includeTextField
    false
    textFieldDefault
    includeCancelButton
    true

Options

  • After Success Default , Tags: debug
    Notification Info
    Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.