Macro Question

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

Macro Question

Kirmse Robert
Dear group,

I was wondering if it is possible to save the content of a variable in a
macro to the next
run of it.

I need this because I want to process some images and save different ROIs as
XY data.
It would speed up the process if I could just press a key and a macro calls
the "save as XY" (that´s no problem) but inserts by itself the path and an
increasing number to the filename
like
data001.txt -> data002.txt and so on.

So I am searching a possiblility to store the path and an integer in
variables (increasing the integer after every save action) but without
loosing the values after the termination of the macro.

I have looked through the examples but maybe I overlooked something or maybe
it is not possible at all.


Thanks in advance

cheers
robert
Reply | Threaded
Open this post in threaded view
|

Re: Macro Question

Wayne Rasband
> I was wondering if it is possible to save the content
>  of a variable in a macro to the next
>  run of it.
>
> I need this because I want to process some images and
> save different ROIs as XY data.
> It would speed up the process if I could just press a key
> and a macro calls  the "save as XY" (that´s no problem) but
> inserts by itself the path and an increasing number to the
> filename like data001.txt -> data002.txt and so on.
>
> So I am searching a possiblility to store the path and an
> integer in variables (increasing the integer after every save
> action) but without  loosing the values after the termination of the
> macro.
>
> I have looked through the examples but maybe I overlooked
> something or maybe it is not possible at all.

Use global variables. There is an example at

     http://rsb.info.nih.gov/ij/developer/macro/macros.html#variables

-wayne
Reply | Threaded
Open this post in threaded view
|

AW: Macro Question

Kirmse Robert
Thank you wayne,
I stumbled over it some time after i posted the question.
But anyway thank you for taking time to answer.

Regards
robert


-----Ursprüngliche Nachricht-----
Von: ImageJ Interest Group [mailto:[hidden email]] Im Auftrag von Wayne
Rasband
Gesendet: Mittwoch, 24. August 2005 15:24
An: [hidden email]
Betreff: Re: Macro Question

> I was wondering if it is possible to save the content  of a variable
> in a macro to the next  run of it.
>
> I need this because I want to process some images and save different
> ROIs as XY data.
> It would speed up the process if I could just press a key and a macro
> calls  the "save as XY" (that´s no problem) but inserts by itself the
> path and an increasing number to the filename like data001.txt ->
> data002.txt and so on.
>
> So I am searching a possiblility to store the path and an integer in
> variables (increasing the integer after every save
> action) but without  loosing the values after the termination of the
> macro.
>
> I have looked through the examples but maybe I overlooked something or
> maybe it is not possible at all.

Use global variables. There is an example at

     http://rsb.info.nih.gov/ij/developer/macro/macros.html#variables

-wayne