title: [ImageJ Macro]: How to save plot profile data in a text file?
body: <p>I want to make a simple ImageJ macro that draws a profile plot along a given linescan and saves the results in a .txt file. So far, I have:</p>
  
  <pre><code>run("Plot Profile");
  saveAs("Text", "/path/to/file/Values.txt");
  </code></pre>
  
  <p>This creates the plot in a new window, but then returns an error, stating that a TextWindow is required. I have the suspicion that the macro tries to save the image itself as text instead of the plot data.</p>
  
  <p>How can I implement a macro that does exactly the same as if I were clicking on the "Save As" button of the profile plot or "List -> Save As" ?</p>