This could be done similar to this example:
_command void _cbsave_run_my_cmd() name_info (','VSARG2_EDITORCTL)
{
activate_build ();
_str cmdline=<my external command> :+ " " :+ maybe_quote_filename( p_buf_name ) :+ " 2>&1";
concur_command (cmdline, false, true, false, false);
}
Made it a _command that you can test it on SE cmdline.
HS2