Forum Discussion

sajin_ss's avatar
sajin_ss
New Contributor
13 years ago

Handle Thread/BackgroundWorker process on button click

I have doubt to scripting in c# for the following scenario,

On Print click there are thread to process image and it may or may not be take more time depends on image. After Print complete one message box will display to inform user whether print complete or not.



Problem is, before complete process the script is calling to click on message button. I have to delay the process till the Thread/BackgroundWorker process complete.



Code :

var printButton =...["ContentPresenter"]["ImagebuttonPrint"];

printButton["Click"](47, 13);



// thread and BackgroundWorker process is here

// I want to delay the process here till 
process complete 



var okButton=...["ContentPresenter"]["ProcessCompleteMessage"]["ImageButtonOk"]

okButton["Click"](45, 14);






Thanks in advance.



Regards,

Sajin

1 Reply

  • sbkeenan's avatar
    sbkeenan
    Frequent Contributor
    Hi Sajin



    Where you are assigning the okButton  variable, you could introduce a 'WaitChild' or 'WaitAliasChild' method for the [ProcessCompleteMessage]  section.



    I'm not very familiar with the C# version of the syntax, but something like this:



    var okButton = ...["ContentPresenter"]["WaitAliasChild"]("ProcessCompleteMessage", 120000)["ImageButtonOk"]



    assuming that you are using the 'alias' version. 



    You should be abel to find all you need if you search for 'WaitAliasChild' in the online Help.



    Regards

    Stephen.