Login  Register

Re: active mouse within a macro

Posted by Christine Labno-2 on Nov 05, 2015; 4:20pm
URL: http://imagej.273.s1.nabble.com/active-mouse-within-a-macro-tp5014856p5014861.html

Hi Jeremy,

How about a wait for user command?  That would pause the macro and pop up a dialog box instructing the use to click on the desired image and then to click OK in the dialog box.  The clicked image would then be the "current" image, so the macro would do the processing you want, and then you could insert a second wait for user command to pause and allow clicking on the second image to process.  So your code would look like this:

waitForUser("click the first image");

//  code to process first image here

waitForUser("click the second image");

// code to process second image here


Best,
Christine

--------------------------------------------
Christine Labno, Ph.D.
Asst. Technical Director
Light Microscopy Core
University of Chicago
Office of Shared Research Facilities
KCBD 1250 900 E. 57th St.
(773) 834-9040 (phone)

________________________________________
From: ImageJ Interest Group [[hidden email]] on behalf of Jeremy Adler [[hidden email]]
Sent: Thursday, November 05, 2015 9:30 AM
To: [hidden email]
Subject: active mouse within a macro

I would like to use the mouse within a macro to select a pair of images to process - I can't see how.

I can give the images names before the macro runs and use the names within the macro, but it would be much less just to select them with the mouse.

Suggestions would be appreciated.



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

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