Action

ShellScript: Ruby Example

Posted by agiletortoise, Last update 7 months ago

Run simple shell Ruby shell script. Mac only.

Steps

  • script (macOS only)

    let script = `#!/usr/bin/env ruby
    ARGV.each do |a|
      puts "Argument: #{a}"
    end
    `;
    let runner = ShellScript.create(script);
    
    if (runner.execute(["1", "2"])) {
    	alert("STDOUT:\n" + runner.standardOutput);
    }
    else {
    	alert("STDERR:\n" + 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.