mrrlg Posted November 18, 2004 Share Posted November 18, 2004 I am attempting to automate a patch application using Oracle's Universial Installer. When I use the Active Window info to "spy" on the test installation I was able to successfully install the patch on my test machine using the x and y coordinates for the Mouse Position. However, when I attempt to run the script on another machne that has a different screen resolution, the script dies. The pixel color under the mouse is the same for every active button. No information is returned for Last Control Under Mouse, Staus Bar Text, Visable Window Text or Hidden Window Text. Is there any way short of constructing a script for each screen resolution to tell the mouse where to go? Link to comment Share on other sites More sharing options...
ezzetabi Posted November 18, 2004 Share Posted November 18, 2004 (edited) You probably are using Absolute coordinates. This kind of problems should be avoided with coodinates relative to the window. So where ever the window is (so what ever resolution) until the window don't change size you'll click your button. Check Opt() for: MouseCoordMode PixelCoordMode If the window also change size you should also check WinMove() to resize it to a know size. Edited November 18, 2004 by ezzetabi Link to comment Share on other sites More sharing options...
scriptkitty Posted November 18, 2004 Share Posted November 18, 2004 add a calculation for screen higth and width. Also, is the installer running full screen? if not, make sure Opt("MouseCoordMode", 0) ;1=absolute, 0=relative. As far as colors, gamma adjustments are not all the same on different computers/video cards. Just a little info to help. AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
ezzetabi Posted November 18, 2004 Share Posted November 18, 2004 Or just WinMove ( "title", "text", 0, 0 ,640 ,480) and regulate the script on this size that will work in every Windows system. Link to comment Share on other sites More sharing options...
mrrlg Posted November 18, 2004 Author Share Posted November 18, 2004 I added the opt("MouseCoordMode",0) to my script, that did not seem to help. When I changed the resolution of the Active desktop to 1024x768, then the first mouse command worked. Is there a way to script a screen resolution change? Link to comment Share on other sites More sharing options...
this-is-me Posted November 18, 2004 Share Posted November 18, 2004 You will also need to change your script accordingly if the window was not at the top left of the screen when you created the script. As for changing resolution, you can't do it with autoit. You can try a command line tool. Who else would I be? Link to comment Share on other sites More sharing options...
mrrlg Posted November 18, 2004 Author Share Posted November 18, 2004 On the original machine that I wrote the script, the window did not open in the upper left hand corner so that would skew my x and y coordinates. Is there a way to force that? Link to comment Share on other sites More sharing options...
scriptkitty Posted November 18, 2004 Share Posted November 18, 2004 (edited) since you wrote the script in absolute mode, you will have to adjust every movement, or adjust the window. If you can find the size and location of the window on your original machine, you can set that in the script. WinMove ( "title", "text", 100, 200 ,640 ,480) WinMove ( "title", "text", x, y [, width [, height]] ) set this and then you can use your mouse in any resolution as long as the full window fits in it. It will be closer to upper left on higher resolution machines. basically your absolute should match since we are moving the window to match where it was on the first machine. Also you should use the same Opt("MouseCoordMode", 1) ;1=absolute(default), 0=relative. #note to remember, try to use relative x,y coords when doing installs. Edited November 18, 2004 by scriptkitty AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
mrrlg Posted November 19, 2004 Author Share Posted November 19, 2004 Not quite sure I did this right. I got the windows coordinates from the original machine and added this portion to my script. The mouse still skitters off to one side and the script stops after the first window opens. AutoitSetOption("WinTitleMatchMode",4) Run("\\aoofs\oracle\2376472\Disk1\setup.exe") WinMove("Oracle Universal Installer", 192, 144, 646, 512) WinWaitActive("Oracle Universal Installer") MouseClick ("Left", 752,627) WinMove("Oracle Universal Installer", 192, 144, 646, 512) WinWaitActive("Oracle Universal Installer") MouseClick ("Left", 752,627) WinMove("Oracle Universal Installer", 192, 144, 646, 512) WinWaitActive("Oracle Universal Installer") MouseClick ("Left", 752,627) WinMove("Oracle Universal Installer", 192, 144, 646, 512) WinWaitActive("Oracle Universal Installer") MouseClick ("Left", 77,483) WinMove("Exit", 385, 258, 260, 168) WinWaitActive("Exit") MouseClick ("Left", 170,144) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now