Ikillu762 Posted August 5, 2017 Posted August 5, 2017 I can't get WinActivate() to work I am trying to get it to activate a google chrome window
MattHiggs Posted August 6, 2017 Posted August 6, 2017 You know what, never mind. I don't need or want to see it: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_SaveSource=y #AutoIt3Wrapper_Res_Language=1033 #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.15.0 (Beta) Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here $win = WinWait ( "[CLASS:Chrome_WidgetWin_1]" ) WinActivate ( $win ) WinWaitActive ( $win )
Ikillu762 Posted August 6, 2017 Author Posted August 6, 2017 Ok. I wasn't sure how the WinWait and WinActivate worked All I had was this: Example() Func Example() WinActivate(Chrome) EndFunc Thanks. Do you have a code snippet that explains/shows how to simulate a mouse Click the (left button) at a set of cords?
MattHiggs Posted August 6, 2017 Posted August 6, 2017 (edited) Well that depends. Are the cordinates relative to the Active Window or the whole screen? Also, have you discovered the AutoIt Window Info tool? Edited August 6, 2017 by MattHiggs
Ikillu762 Posted August 6, 2017 Author Posted August 6, 2017 I assume it is sort of possible to be both, but it is better I try for the whole screen
MattHiggs Posted August 6, 2017 Posted August 6, 2017 Well it defaults to the whole screen, so there is that. Have you discovered the AutoIT window info tool:
Ikillu762 Posted August 6, 2017 Author Posted August 6, 2017 I have not. Is it included with the install?
MattHiggs Posted August 6, 2017 Posted August 6, 2017 All you have to do is, using this tool, drag and drop the crosshairs onto the spot where you want the mouse to click, then go to the below tab:
MattHiggs Posted August 6, 2017 Posted August 6, 2017 Then, use the below function, which will perform a left click at the coordinates you obtained from the Window info tool. The below code uses the values seen in the picture of previous post. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_SaveSource=y #AutoIt3Wrapper_Res_Language=1033 #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.15.0 (Beta) Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here MouseClick ( "left", 841, 202 )
Ikillu762 Posted August 6, 2017 Author Posted August 6, 2017 Nevermind. I'm such a noob. I just found it. Thank you!
Ikillu762 Posted August 6, 2017 Author Posted August 6, 2017 Obviously my next problem is going to be how to figure out a way to script an image-on screen- check/validate+locate
MattHiggs Posted August 6, 2017 Posted August 6, 2017 Also, a word to the wise. I don't know what it is you are trying to get your script to do, but be aware that, if the application/window which you are trying to have your script interact with is elevated (run with admin credentials), the script will also need to be compiled to run with admin permissions.
MattHiggs Posted August 6, 2017 Posted August 6, 2017 1 minute ago, Ikillu762 said: Obviously my next problem is going to be how to figure out a way to script an image-on screen- check/validate+locate Well not obvious to me. I am not sure what it is you are trying to do. If you shared some details, I might be able to help.
Ikillu762 Posted August 6, 2017 Author Posted August 6, 2017 Ok. I did see somewhere that that was a possibility. I am simply trying to automate some browser (tasks) capabilities
Ikillu762 Posted August 6, 2017 Author Posted August 6, 2017 Since I have no way of reading packets that I can't seem to find, I am trying to include an image check to ensure that a portion of the web-page is where it should be
MattHiggs Posted August 6, 2017 Posted August 6, 2017 In that case, I would advise against doing it in chrome. Autoit has functions built into it which provide ways to automate internet explorer in very advanced ways, and I would recommend using those for web-based automation
MattHiggs Posted August 6, 2017 Posted August 6, 2017 1 minute ago, Ikillu762 said: Since I have no way of reading packets that I can't seem to find, I am trying to include an image check to ensure that a portion of the web-page is where it should be Yeah, you are going about this the wrong way then. You need to be using the Internet explorer functions to write the script, as web browsers don't function the same as native applications.
MattHiggs Posted August 6, 2017 Posted August 6, 2017 Again. specifics. If you tell me what you are trying to do, I might be able to help more.
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