DONE: Tool output

Make a request or discuss new features.
Post Reply
kosthala
Posts: 49
Joined: 18 Feb 2014 21:36

DONE: Tool output

Post by kosthala »

Is it possible to capture a tool output (DOS command) in real-time in messages pane instead of waiting for the tool to finish first?
User avatar
pjj
Posts: 2109
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: Tool output

Post by pjj »

Interesting question. I did some experiments and I guess the answer is no.

I used BAT file

Code: Select all

:start
echo #
goto start
because timeout command didn't work; of course I had to kill RJ TE, but the output was clear all the time. Then I wrote a small PHP script:

Code: Select all

<?php
echo "PHP\n";
for ($i = 0; $i < 5; $i++) {
    echo $i, "\n";
    sleep(1);
}
and it produced the output only after the run was completed.
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
User avatar
micha_he
Posts: 570
Joined: 24 Jul 2011 12:16
Location: Helmstedt, NDS, Germany

Re: Tool output

Post by micha_he »

But that would be a practical improvement. Maybe Rickard can modify it!?
User avatar
pjj
Posts: 2109
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: Tool output

Post by pjj »

micha_he wrote: 09 Nov 2022 07:58 But that would be a practical improvement.
My hunch, too, even though at the moment I can't point to any concrete case where it would be helpful. ...And the implementation would beg for a way to terminate the tool running in the background when you could observe its output "live", methinks.
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
User avatar
Rickard Johansson
Site Admin
Posts: 6577
Joined: 19 Jul 2006 14:29

Re: Tool output

Post by Rickard Johansson »

In the tool item dialog window - set "Run as DOS command and capture output" and "Run in background".

That should run the tool in a different thread and capture the output whenever the tool decides to output some information...
User avatar
pjj
Posts: 2109
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: Tool output

Post by pjj »

Rickard Johansson wrote: 10 Nov 2022 19:06 In the tool item dialog window - set "Run as DOS command and capture output" and "Run in background".

That should run the tool in a different thread and capture the output whenever the tool decides to output some information...
That is my configuration, and still the output isn't captured piecemeal, but only on completion of tool's run. Moreover, "Halt a running script" is unavailable, and it's entry in the menu is dimmed. However, when I click on the icon to run the tool again, I get a message that the tool is running and I can stop it.

Btw. after completing the run I got "Process completed with exit code: 259" message (usually it's 0).
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
User avatar
pjj
Posts: 2109
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: Tool output

Post by pjj »

Correction: PHP code I posted above will always display output after it has run; here's the proper one:

Code: Select all

<?php
for ($i = 0; $i < 5; $i++) {
    echo $i, "\n";
    flush();
    sleep(1);
}
It runs piecemeal on the command line (> php.exe test.php), but as a tool it waits for its completion and only then shows its output.
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
User avatar
Rickard Johansson
Site Admin
Posts: 6577
Joined: 19 Jul 2006 14:29

Re: Tool output

Post by Rickard Johansson »

Should work better in next version (15.66). Thanks!
User avatar
micha_he
Posts: 570
Joined: 24 Jul 2011 12:16
Location: Helmstedt, NDS, Germany

Re: DONE: Tool output

Post by micha_he »

Works with AutoIt-Tools too, but a single CRLF at the end of an output-sting is lost !?
User avatar
micha_he
Posts: 570
Joined: 24 Jul 2011 12:16
Location: Helmstedt, NDS, Germany

Re: DONE: Tool output

Post by micha_he »

Can we get an additional option to open the normally minimized Messages-window, when the tool output is inserted there, not only at the tool-exit/-end?

And: The problem with the CRLF above, still exists in V15.68.
User avatar
micha_he
Posts: 570
Joined: 24 Jul 2011 12:16
Location: Helmstedt, NDS, Germany

Re: DONE: Tool output

Post by micha_he »

The problem with the lost CRLF still exists in V15.83.

And the "Messages"-windows is receive the output-text while the tool is running, but the "Messages"-windows remains unfortunately minimized and is maximized only when the tools ends.
User avatar
Rickard Johansson
Site Admin
Posts: 6577
Joined: 19 Jul 2006 14:29

Re: DONE: Tool output

Post by Rickard Johansson »

The problem with the lost CRLF still exists in V15.83.
It's not something I can reproduce. It should work with CRLF, CR and LF. As long as the tool running in the background outputs CRLF's.
And the "Messages"-windows is receive the output-text while the tool is running, but the "Messages"-windows remains unfortunately minimized and is maximized only when the tools ends.
That is by design. A minimized panel wont stay open unless it has focus. You wont be able to edit or do anything if you want the minimized panel to stay open. The moment it loses focus - it will minimize again. Unless you pin it.
Just open and pin it when you run the tool.
User avatar
micha_he
Posts: 570
Joined: 24 Jul 2011 12:16
Location: Helmstedt, NDS, Germany

Re: DONE: Tool output

Post by micha_he »

Rickard Johansson wrote: 29 Mar 2023 17:14
The problem with the lost CRLF still exists in V15.83.
It's not something I can reproduce. It should work with CRLF, CR and LF. As long as the tool running in the background outputs CRLF's.
Repeat the test when "Run in backgroud" is activated!

Edit: Here's my test-tool (compiled AutoIt), which runs flawlessly in the windows commandline.
output-test_RJTED.zip
(451.34 KiB) Downloaded 72 times
User avatar
Rickard Johansson
Site Admin
Posts: 6577
Joined: 19 Jul 2006 14:29

Re: DONE: Tool output

Post by Rickard Johansson »

Fixed in next release (v15.84). Thanks!
Post Reply