Get Xdotools returned value in Java
<p>I'm using Xdotools to generate some keyboard inputs into Ubuntu xterms.
For example:</p>

<pre><code>ProcessBuilder pb = new ProcessBuilder("xdotool windowactivate xxx");
pb.start();
ProcessBuilder pb2 = new ProcessBuilder("xdotool type ls -a");
pb2.start();
ProcessBuilder pb3 = new ProcessBuilder("xdotool key Return");
pb3.start();
</code></pre>

<p>For the last line I can't get the result string of the ls -a (the ls -a is just an example I have more complicated commands). The <code>getOutputStream()</code> method return an empty string. Is it possible to get the return of the command with xodotools or logging the xterm like:</p>

<pre><code>ProcessBuilder pb = new ProcessBuilder("xterm &gt; mylogFile");
    pb.start();
</code></pre>

<p><strong>EDIT</strong></p>

<p>I copy my log file so you will better understand what is my problem:</p>

<pre><code> 2012-05-15 13:55:39,259 [NioProcessor-1] INFO  util.Command - Command - executing cmd:xdotool search --name TARGET-0.10335532780847267-64ac9a9b-746f-447f-9092-06943bafa9b1
    2012-05-15 13:55:39,391 [NioProcessor-1] INFO  util.Command - Command - returnedString:56623140
2012-05-15 13:55:39,392 [NioProcessor-1] INFO  util.Command - Command - exitValue:0
        2012-05-15 13:55:39,594 [NioProcessor-1] INFO  util.Command - Command - executing cmd:xdotool windowactivate 56623140
        2012-05-15 13:55:39,611 [NioProcessor-1] INFO  util.Command - Command - returnedString:
        2012-05-15 13:55:39,612 [NioProcessor-1] INFO  util.Command - Command - exitValue:0
        2012-05-15 13:55:39,612 [NioProcessor-1] INFO  util.Command - Command - executing cmd:xdotool type "echo my_text &gt; fpl_tmp"
        2012-05-15 13:55:41,936 [NioProcessor-1] INFO  util.Command - Command - returnedString:
        2012-05-15 13:55:41,937 [NioProcessor-1] INFO  util.Command - Command - exitValue:0
        2012-05-15 13:55:41,938 [NioProcessor-1] INFO  util.Command - Command - executing cmd:xdotool key Return
        2012-05-15 13:55:41,967 [NioProcessor-1] INFO  util.Command - Command - returnedString:
        2012-05-15 13:55:41,967 [NioProcessor-1] INFO  util.Command - Command - exitValue:0
</code></pre>

<p>And I have the same problem with the <em>pwd</em> command:</p>

<pre><code>2012-05-15 13:55:42,766 [NioProcessor-1] INFO  util.Command - CommandExec - executing cmd:xdotool type  pwd
2012-05-15 13:55:42,800 [NioProcessor-1] INFO  util.Command - Command - returnedString:
2012-05-15 13:55:42,800 [NioProcessor-1] INFO  util.Command - Command - exitValue:0
2012-05-15 13:55:42,800 [NioProcessor-1] INFO  util.Command - CommandExec - executing cmd:xdotool key Return
2012-05-15 13:55:42,828 [NioProcessor-1] INFO  util.Command - Command - returnedString:
2012-05-15 13:55:42,829 [NioProcessor-1] INFO  util.Command - Command - exitValue:0
</code></pre>

<p>Note that my return value function: <em>returnedString</em> is working cause I managed to get the return value of my first command but for the other ones it doesn't work at all.</p>
