Re: Easy Macro question

Posted by dscho on
URL: http://imagej.273.s1.nabble.com/Macro-dialog-prefs-tp3688182p3688185.html

Hi,

On Tue, 25 May 2010, SIMMONS, RICK L [AG/1850] wrote:

> The following macro works fine until the last line.  The Plot Profile
> command executes, but the file is not saved.  No error messages appear.
>
> [...]
>
>    run("Plot Profile", "save=c:\\rls\\test.xls");

The "Plot Profile" plugin is only recordable insofar it shows the plot
window.

To get at the plot values from the Plot Profile, you will need to use the
Plot.getValues() macro function. Example:

http://rsb.info.nih.gov/ij/macros/examples/PlotGetValuesDemo.txt

To save the values to a file, you will need to use the File.open(),
print() and File.close() methods. Example:

http://rsb.info.nih.gov/ij/macros/SaveTextFileDemo.txt

(Note that this example does not call File.close(), which might result in
a short write, i.e. an incomplete file)

Hth,
Johannes