I tried your code. But the problem is i do not want to stop the script execution at any point of time. My scenario is, application will be running. At times it will take some time to identify an object in the screen, so the applicaion will stand still for a few seconds. At this point of time, a pop up should come up saying that 'Script is running. Please wait'. In short the script executiona and the display of popup should happen side by side.