Hi Norbert,
macros are designed to do everything sequentially, otherwise it would
be a big mess...
What you can do: If you have a macro that has its own menu command
(by installing it), you can start it in a separate thread by
call("ij.IJ.doCommand", commandName);
where commandName is the menu command. This will start it in a
separate thread, Then you can have, e.g., a wait statement in that
macro and it won't block everything else.
Michael
________________________________________________________________
On 20 Nov 2009, at 18:08, Norbert Vischer wrote:
> Hello List,
> is it possible to employ different threads within the same macro
> set? In the example below, I get output 1-3-2, because the macro
> won't finish before the function f3 is executed. However, I would
> like to finish the macro immediately and obtain output 1-2-3,.
> I need this because I want to exit and enter different "while"
> loops depending on user action.
>
> Norbert Vischer
>
>
> macro "test"{
> print(1);
> f3();
> print(2);
> }
>
> function f3(){
> wait(500)
> print(3);
> }
>
> ======
> output:
> 1
> 3
> 2