dusty071 Posted September 23, 2014 Share Posted September 23, 2014 Hi, im trying to find the exact coordinates of IE object on the screen. _IEPropertyGet($oDiv, "screeny") gets the closest, since its correct until you scroll down. The coordinates stay in place even if you scroll, making the screen coordinates of that element wrong the moment you start scrolling. Ive been trying to find the current number of pixels that the page is scrolled and then add it to the screeny property, but none of the functions im finding dont seem to return the current scrolled value. I tried $oIE.document.window.pageYOffset , .scrolltop, etc. Maybe im not using them correctly, or they just dont work. Help much appreciated. Link to comment Share on other sites More sharing options...
caramen Posted September 23, 2014 Share Posted September 23, 2014 (edited) You have to recalculate after Each Scroll I had an idea for you may you can use #include <Misc.au3> If _Ispressed ("***") Then "recalculate" The only unknow thing is, i am not sure you have an exa code for the mouse scroll ... "?" Or even maybe that : If MouseWheel ( "up") or MouseWheel ( "down") Then "recalculate " Edited September 23, 2014 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
dusty071 Posted September 23, 2014 Author Share Posted September 23, 2014 Example: #include <IE.au3> HotKeySet("{NUMPADADD}", "_mousemove") $oIE = _IECreate("http://www.autoitscript.com/forum/topic/164509-ie-screenx-property-messes-up-if-you-scroll-how-to-fix/") $oDiv = _IEGetObjById($oIE, "post_id_1200002") ;if i use scrollintoview which i need to, the coords get wrong since any type of scrolling ruins screenx and screeny ;_IEAction($oDiv, "scrollintoview") While 1 ToolTip("screenx: " & _IEPropertyGet($oDiv, "screenx") & " screeny: " & _IEPropertyGet($oDiv, "screeny"), 0, 0) Sleep(1000) WEnd Func _mousemove() MouseMove(_IEPropertyGet($oDiv, "screenx"), _IEPropertyGet($oDiv, "screeny"), 0) EndFunc You can use numpad+ to test the coords. You can see that the coords are correct even if you move the window around, but the moment you do any type of scrolling the coords are ruined. I think i only need the number of pixels that the page is scrolled at the moment so that i can add it to the screeny. Link to comment Share on other sites More sharing options...
jdelaney Posted September 23, 2014 Share Posted September 23, 2014 Focus brings the object into view...no need for complicated movements _IEAction($oObj,"Focus") killertone 1 IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
caramen Posted September 24, 2014 Share Posted September 24, 2014 You can use numpad+ to test the coords. You can see that the coords are correct even if you move the window around, but the moment you do any type of scrolling the coords are ruined. I think i only need the number of pixels that the page is scrolled at the moment so that i can add it to the screeny. Try coordinate mode with windows and use the methode i said you , logicaly it should work. My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
mikell Posted September 24, 2014 Share Posted September 24, 2014 Maybe try : _IEPropertyGet "browserx" and "browsery" + WinGetPos(browser) 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