MGuyM Posted November 23, 2006 Report Share Posted November 23, 2006 Hello. This is my first post here. I've read through just about every message on this board trying to see if I could find the answer to my problem before I am forced to post it myself. Here's my issue..... I have to Web Browsers that are running the same Java Application. I wrote a macro to go through and click the appropriate prompts in each browser based on where in the program it's necessary. The problem that I'm having is that the Java Application that is running in the Window will popup windows that need to be clicked on. I've tried putting in the following routine to wait for the Pop-up to appear: Clear Integer Variables: From 99 to 99 Repeat Until %N99% <> 3421493 Activate Window: "%T1%" Delate 1 Seconds Get Pixel: Window Coords: 347,358 into %N99% If Variable %N99% = 3421493 Mouse Move Window 294,383 Mouse Left Button Click End If Repeat End The Problem I have is that my Macro runs too fast and ends up missing the Pop-Up because it checked the Screen for the the Pixel BEFORE the Pop-up Appeared and it continued past this point. I need the Macro to wait for the Pop-up to appear before it does the above checking, but I don't know when that pop-up appears. Can any one help me with a solution to this problem? I need the macro to run as fast as possible and I've tried putting "delays" in the Macro before the Pop-Up appears, but it runs too slow. I need the routine to run as fast as possible. Any Thoughts??? Thank You in Advance MGuyM Quote Link to comment Share on other sites More sharing options...
Strathos Posted November 23, 2006 Report Share Posted November 23, 2006 Hello MGuyM Do the pop-up windows's name have a word in common? In that case you could simply use Wait For Window Title: "Pop-Up" Quote Link to comment Share on other sites More sharing options...
MGuyM Posted November 23, 2006 Author Report Share Posted November 23, 2006 There is NO Title Bar in the Popup. Otherwise, I'd be using that. The Best I could do was to watch for the Screen Color to Change in the location of the Popup. But my routine is running too fast and it does the color check before the popup appears. Thanks for the help. Do you have any other suggestions? Quote Link to comment Share on other sites More sharing options...
Strathos Posted November 23, 2006 Report Share Posted November 23, 2006 The pop-up window is not separated from the web browser then? Guess you can't use Controls neither. Does the pop-up appear always in the same place? I don't see why the script you posted wouldn't work. It checks the color before the popup appears, but it will only click if the pixel color becomes 3421493.. Quote Link to comment Share on other sites More sharing options...
MGuyM Posted November 23, 2006 Author Report Share Posted November 23, 2006 Yes the Window is always in the Same Place. When the Routine is called, the first time through it Does the Get Pixel and sets N99 to the Pixel Color. The problem is that I'm expecting the window to already be displayed, but unfortunately the Pop-up hasn't appeared yet and therefore the Pixel that is read is the Under Color and therefore is set to a value other then 3421493. While writing the above, I had a thought...... Do you know if you can do the following: Repeat Until %N99% <> 3421493 AND If Variable %N99% <> "underlying color" If I can do something like the above, I can add right after the CLICK to set N99 to a value that I know it won't be and then it should work. But I couldn't find anywhere where you can Nest the Repeat. Do you know if you can do the above? Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.