cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

weblink doesn't wait for runMacro() to finish

Highlighted
Moonstone

weblink doesn't wait for runMacro() to finish

I have a weblink application that does the following:
1. define a complicated macro s
2. runs this macro with runMacro(s)
3. does some other weblink stuff

The problem is that weblink doesn't wait for Pro/Engineer to finish
with runMacro() in step 2 before continuing on with step 3.

Does anybody have a hint/workaround/solution on how to get weblink
to wait for runMacro() to complete before continuing on?

WildFire 2.0 M190

Thanks
1 REPLY 1

Re: weblink doesn't wait for runMacro() to finish

hi Randy.

I have tried a couple of methods to make Macros and map keys run asynchronous

the application i am currently working on has a couple of macros, and i have found that by far the simplest way to get them to run and then stop is either to build them naturally into breaks in the code, (eg i have 3 Html pages from which the user supply input information, the macro for each stage of the process runs between pages, so when the user clicks next it redirects the page, and triggers the macro which runs and completes before presenting the next inputs page.

the other option is to set a timeout around the macro

setTimeout(function () {"some code"},1000);

this allows the weblink code and the macro to run asynchronously.

hope this helps