Author Topic: Running a shell command and sending output to the build window  (Read 5848 times)

groman

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Running a shell command and sending output to the build window
« on: November 11, 2009, 02:43:44 AM »
Hello,

I am not sure this is the right forum. What I want to accomplish is basically have a toolbar button that runs a Slick-C Macro with the currently open filename, which eventually runs a shell script. I want this shell script output to be captured and sent to the "Build" window (with error processing so I can click on errors). I don't want any separate shell windows to pop-up or anything. Is such a thing possible?

Currently my macro just calls "shell()" which spawns off a different window, but this is not what I want.

If it matters, I'm using Slickedit 12.03 on Windows XP.

Best regards,

Groman

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Running a shell command and sending output to the build window
« Reply #1 on: November 11, 2009, 10:18:30 AM »
Basically you need sth. like this:
Code: [Select]
_command void cat() name_info (','VSARG2_READ_ONLY|VSARG2_REQUIRES_EDITORCTL)
{
   activate_build ();
   // uncomment to clear build window
   // clear_pbuffer ();
   _str cmdline="D:\\Tools\\Unix\\wbin\\cat.exe" :+ " " :+ maybe_quote_filename( p_buf_name ) :+ " 2>&1";
   concur_command (cmdline, false, true, false, false);
}

Alternatively you can make use of the project build tools. Have a look here for some details.
Setting error markers automatically is a different problem. But you goto errors by as usual even without the fancy markers being set.

Edit:
You can invoke 'set-error-markers' or this add. macro (serr) manually after the command was executed.

HS2
« Last Edit: November 11, 2009, 10:27:48 AM by hs2 »