Login  Register

Re: Writing to clipboard

Posted by Wayne Rasband on May 02, 2007; 10:05pm
URL: http://imagej.273.s1.nabble.com/Writing-to-clipboard-tp3699632p3699633.html

You will be able to do this in ImageJ 1.38r, due next week.

Here is an example that copies the "Area" column to the system
clipboard:

    String.resetBuffer;
    for (i=0; i<nResults; i++)
        String.append(getResult("Area", i) + "\n");
    String.copy(String.buffer);

ImageJ 1.38r adds six macro functions that do string buffering and copy
strings to and from the clipboard:

    String.resetBuffer - Resets (clears) the buffer.
    String.append(str) - Appends str to the buffer.
    String.buffer - Returns the contents of the buffer.
    String.copy(str) - Copies str to the clipboard.
    String.copyResults - Copies the Results table to the clipboard.
    String.paste - Returns the contents of the clipboard.

-wayne

On Apr 30, 2007, at 12:22 PM, Jung Hoon Shin wrote:

> Dear All,
>
> I am trying to selectively copy one column from Results Window without
> the
> index column into the system clipboard.  I think I can define an array
> in
> macro and assign values from Result Window using getResult("Column",
> row),
> but I could not find a way to copy the values from the array to the
> system
> clipboard.  Thanks in advance for your help.
>
> Hoon
>