Login  Register

Re: add/edit a comment and store it with an image?

Posted by Michael Schmid on Feb 15, 2011; 10:09am
URL: http://imagej.273.s1.nabble.com/add-edit-a-comment-and-store-it-with-an-image-tp3685672p3685677.html

Hi Norbert, Wayne,

indeed, I can confirm that on Mac OS X 10.4.11 (Jave 1.5.0_19), there  
is an almost empty menu bar (only the Apple and the "ImageJ" column)  
for a text window if
   Plugins>Menu>New Text Window...
has the "Menu Bar" option off (I guess that it should rather have the  
standard ImageJ menu bar?)

So, in the macro it should be
         run("Text Window...", "name="+title2+" menu");

Best wishes,

Michael
________________________________________________________________

On 15 Feb 2011, at 02:01, Norbert Vischer wrote:

> In spite of Wayne's explanation I cannot get the following 3 macros  
> to do this:
>
> 1. create an image with metadata "old text"
> 2. put "old text" into a text window so I can change it to "new text"
> 3. put "new text" back to the metadata.
>
> The problem is that after the second macro, all menus disappear (OS  
> X),
> and the window is not editable either.
>
> N. Vischer
> ----------
>
>
> macro "Create Demo image [F1]"{
> newImage("A", "8-bit Ramp", 280, 250, 1);
> setMetadata("Info", "old text");
> }
>
> macro"Show Info [F2]"{
> info = getMetadata("Info");
> title1 = "Description";
> title2 = "["+title1+"]";
> f = title2;
> if (isOpen(title1)){
> selectWindow(title1);
> print(f, "\\Update:"); // clears the window
> }
> else
> run("Text Window...", "name="+title2);
> print(f, info);
> }
>
> macro "Store Info[F3]"{
> str = getInfo("window.contents");
> setMetadata("info", str);
> }