macro runnig out of order

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

macro runnig out of order

jefffalcone
Hello,

I am trying write a simple macro that will create a plot and then close the plot window. This is the code I have:
R=nResults();
yValues=newArray(R);
         for(i=0;i<R;i++)
          {
          yValues[i]=getResult('Mean',i);
          }
xValues=newArray(0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80.85,90,95,100,105,110,115,120,125,130);
Plot.create("test","time (s)", "green intensity",xValues,yValues);

selectWindow("test");
close();

For some reason it wants to run the "selectWindow" command before creating the plot. If I run the first part of the code to create the plot, and then run the second part to close the window, it works fine, so I know the problem is it is running the code out of order. This should be simple and it will save me from making mistakes during my analysis. My goal is to insert this bit of code into a macro that I wrote for batch processing so that I can watch the analysis as it goes to make sure my macro is working the same on all of my images. Any help would be greatly appreciated.


Reply | Threaded
Open this post in threaded view
|

Re: macro runnig out of order

Laurent.guerard
Hello,

I just tried your macro, and I think that if you want to select the plot
window in order to close it, you need to show the plot window with
Plot.show().
Then it should work.
Let me know.

*
*

*Laurent Guerard*

/Centre for Cellular Imaging/

/Core Facilities, the Sahlgrenska Academy/

/University of Gothenburg, Sweden/

//
Mobile: 0766229822

E-mail : [hidden email]

Web : http://www.cf.gu.se/english/Centre_for_Cellular_Imaging/


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: macro runnig out of order

jefffalcone

Hello,


Thank you for your help. I knew it was something simple. Your suggestion works.


Best,

Jeff




From: Laurent.guerard [via ImageJ] <ml-node+[hidden email]>
Sent: Wednesday, March 16, 2016 3:38 AM
To: Jeffrey L Falcone
Subject: Re: macro runnig out of order
 
Hello,

I just tried your macro, and I think that if you want to select the plot
window in order to close it, you need to show the plot window with
Plot.show().
Then it should work.
Let me know.

*
*

*Laurent Guerard*

/Centre for Cellular Imaging/

/Core Facilities, the Sahlgrenska Academy/

/University of Gothenburg, Sweden/

//
Mobile: 0766229822

E-mail : [hidden email]

Web : http://www.cf.gu.se/english/Centre_for_Cellular_Imaging/


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html



If you reply to this email, your message will be added to the discussion below:
http://imagej.1557.x6.nabble.com/macro-runnig-out-of-order-tp5015910p5015913.html
To unsubscribe from macro runnig out of order, click here.
NAML