Forum Discussion

MarcusBengtsson's avatar
MarcusBengtsson
Frequent Contributor
2 years ago

While loop exists

 

Hello! I am trying to clean up some if objects + delays and instead use while loop to wait for objects to be ready but this specific one does not work and I cannot figure out why.

 

What I am trying to do is to stop my program, and while the text as shown in the value "TextblockComTestIsRunning" it is still running so I want it to delay for 5 seconds and recheck again. Once it is stopped the text will be changed to "TextblockComTestisNotRunning". And then it should release the while loop.

 

But even when the program is no longer running it is still delaying over and over again.

 

Thankful for the help!

  • You are checking the property value of Exists for object Aliases.ComTestRibbonMenu.MainBorder.TextblockComtestIsRunning. If you want to check for text then use e.g. Aliases.ComTestRibbonMenu.MainBorder.TextblockComtestIsRunning.contentText?

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    You are checking the property value of Exists for object Aliases.ComTestRibbonMenu.MainBorder.TextblockComtestIsRunning. If you want to check for text then use e.g. Aliases.ComTestRibbonMenu.MainBorder.TextblockComtestIsRunning.contentText?

    • MarcusBengtsson's avatar
      MarcusBengtsson
      Frequent Contributor

      Ohh yes that should do the trick I didn't even think about that. Thank you!