cutbox / CutBox

CutBox makes your macOS pasteboard awesome.
https://cutbox.github.io
Other
168 stars 11 forks source link

[Feature]: allow the user to pipe a paste through shell command. #125

Closed jasonm23 closed 1 year ago

jasonm23 commented 1 year ago

Feature description

I'd like CutBox to let me process a paste through a shell command, so I don't need to use JS.

Version

1.5.3

jasonm23 commented 1 year ago

Added as an extension to the JS processor. The workflow would be to specify a command using JS.

shellCommand(command)

Where command is a shell command and its args.

CutBox will capture the output and paste it.

jasonm23 commented 1 year ago

A useless example:

let hello = function(s) { 
  let command = "printf '+ s +'"
  return shellCommand(command)
}

or

let hello = function(s) { 
  let command = "brew install '+ s +'"
  return shellCommand(command)
}

Where s is the CutBox item(s) selected. The return value will be the shell command output on STDOUT.

jasonm23 commented 1 year ago

Of course, this means you can process a CutBox paste through any language.

jasonm23 commented 1 year ago

30348c13fa1191debe04f221ee3cdcd906121655 implementation + spec.