Login  Register

user prompts during macro run

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

user prompts during macro run

kgeorge
Dear Group,

I'm recording and editing my first macros and would like to learn how to prompt the user for input during a macro run and then return to the macro to complete the analysis.

For example:

1. File Open and Save As

2. Prompting the user for data that could be used in a text field, which would later be applied to the image as a flattened overlay.

3. Prompt the user to decide to invert the image at a specific point in the analysis.

Can someone point me towards relevant examples?

Thank you in advance.

-Ken

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

Re: user prompts during macro run

George Patterson
Hi Ken,
Look at the examples at the sites listed below.
George

1. File Open and Save As

See http://rsb.info.nih.gov/ij/macros/OpenDialogDemo.txt for File Open
See http://rsb.info.nih.gov/ij/developer/macro/functions.html#S for saveAs

2. Prompting the user for data that could be used in a text field, which
would later be applied to the image as a flattened overlay.

http://rsb.info.nih.gov/ij/macros/DialogDemo.txt
See the addString/getString example.

3. Prompt the user to decide to invert the image at a specific point in the
analysis.

See the addCheckbox/getCheckbox example in the DialogDemo.txt.  This will
return a boolean.




On Mon, Nov 4, 2013 at 10:03 AM, Ken George <[hidden email]> wrote:

> Dear Group,
>
> I'm recording and editing my first macros and would like to learn how to
> prompt the user for input during a macro run and then return to the macro
> to complete the analysis.
>
> For example:
>
> 1. File Open and Save As
>
> 2. Prompting the user for data that could be used in a text field, which
> would later be applied to the image as a flattened overlay.
>
> 3. Prompt the user to decide to invert the image at a specific point in
> the analysis.
>
> Can someone point me towards relevant examples?
>
> Thank you in advance.
>
> -Ken
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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

Re: user prompts during macro run

Jim Passmore-2
In reply to this post by kgeorge
Ken,
There are a few very good sources of macro programming documentation at
this link.
http://rsbweb.nih.gov/ij/developer/index.html

The list of "Built-in Macro Functions" (
http://rsbweb.nih.gov/ij/developer/macro/functions.html) will help.
Specifically...
* for example 1, use one of the File commands, such as File.openDialog()
* for #2 & #3, the Dialog commands can be combined to get just about any
info you need from a user.

Enjoy!

Jim


On Mon, Nov 4, 2013 at 10:03 AM, Ken George <[hidden email]> wrote:

> Dear Group,
>
> I'm recording and editing my first macros and would like to learn how to
> prompt the user for input during a macro run and then return to the macro
> to complete the analysis.
>
> For example:
>
> 1. File Open and Save As
>
> 2. Prompting the user for data that could be used in a text field, which
> would later be applied to the image as a flattened overlay.
>
> 3. Prompt the user to decide to invert the image at a specific point in
> the analysis.
>
> Can someone point me towards relevant examples?
>
> Thank you in advance.
>
> -Ken
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>





*-- Jim Passmore*
Research Associate
Sealed Air Corporation

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

Re: user prompts during macro run

kgeorge
In reply to this post by kgeorge
Thanks, works well.

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