engineergrrl Posted April 11, 2013 Share Posted April 11, 2013 This seems like such an elementary question that I can't believe I'm asking this, but I've searched the forums and help docs and could not find an answer. Here's the scenario: I have sent the Tab key several times, and an icon is now highlighted. Here's the issue: I need to move the mouse to that icon (i.e. the current cursor position). When I write tests to take this action on just one machine, I simply get the coordinates of the icon and use that. But I now need to run this test on many machines, of all different resolutions, so that will not work. Any ideas? Link to comment Share on other sites More sharing options...
UEZ Posted April 11, 2013 Share Posted April 11, 2013 Show us your code please. Thx, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
somdcomputerguy Posted April 11, 2013 Share Posted April 11, 2013 Maybe this helps - Function AutoItSetOption. See MouseCoordMode. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
jdelaney Posted April 11, 2013 Share Posted April 11, 2013 (edited) Is this a browser, or window app. I'd stick with the control*/_IE* functions rather than tabs to move between controls. controlgetfocus to return the focused control $oIE.activeelement to return the focused browser control...where $oIE is the dom object from _IEcreate Edited April 11, 2013 by jdelaney 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...
engineergrrl Posted April 11, 2013 Author Share Posted April 11, 2013 Is this a browser, or window app. I'd stick with the control*/_IE* functions rather than tabs to move between controls.controlgetfocus to return the focused control$oIE.activeelement to return the focused browser control...where $oIE is the dom object from _IEcreateIt's the Windows 8 Search screen...the source of all my woes, heh. Essentially the issue here is that I need to be able to right-click on an icon so I can run an application as administrator. Link to comment Share on other sites More sharing options...
jdelaney Posted April 11, 2013 Share Posted April 11, 2013 throw this at the top of your script: #RequireAdmin and then run through the run() 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...
engineergrrl Posted April 11, 2013 Author Share Posted April 11, 2013 throw this at the top of your script:#RequireAdminand then run through the run()Thank you so much ! My one issue now: is there any way to bypass the UAC prompt that occurs here? AutoIt seems to get suspended when the UAC prompt appears, and so I have to manually select "Yes" to allow AutoIt to execute the script. Link to comment Share on other sites More sharing options...
jdelaney Posted April 11, 2013 Share Posted April 11, 2013 (edited) You can create a scheduled task, and run it as highest priority...then you can execute with cmd line schtasks /run /tn scheduled_taskname_you_created Edited April 11, 2013 by jdelaney 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...
engineergrrl Posted April 11, 2013 Author Share Posted April 11, 2013 You can create a scheduled task, and run it as highest priority...then you can execute with cmd lineschtasks /run /tn scheduled_taskname_you_createdThank you so much!! This option worked . I really appreciate all of your help!To be specific about what I did to get this working in Windows 8: I used the Task Scheduler tool (which for some reason in Win 8 only shows up in search if you search for "Schedule Task", weirdly, though the tool is actually still named Task Scheduler) to create a time-based task. I set it to "Run With Highest privileges". Then for my script, I began the script with #RequireAdmin, and then used the run() command to launch PowerShell.Just figured I'd include these details here in case anyone else is also using Win 8 and does a search for a problem like this in the future. 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