JJohnson Posted February 23, 2010 Share Posted February 23, 2010 Hello I've been using AutoIt3 for a few months now and it is very helpful for doing certain tasks. I've been having some trouble though and wonder if this can be solved easily. Here is my conditional statement: If ControlGetText("", "", 10) = "How many letters in the word dog?" Then If ControlGetText("", "", 1) = "3" Then ControlClick("", "", 1) ElseIf ControlGetText("", "", 2) = "3" Then ControlClick("", "", 2) ElseIf ControlGetText("", "", 3) = "3" Then ControlClick("", "", 3) ElseIf ControlGetText("", "", 4) = "3" Then ControlClick("", "", 4) EndIf ControlClick("","", 20) Is there some way to use: If ControlGetText("", "", 1) like "%3%" Then ?? Sorry for my SQL syntax. Is there a way to use an if/then statement in this manner? Also, I noticed someone posted this in the faq: Q21. Why my script doesn't work on locked station? A21. On locked station any window will never be active (active is only dialog with text "Press Ctrl+Alt+Del") In Windows locked state applications runs hidden (behind that visible dialog) and haven't focus and active status. So generally don't use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc. Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc. This way you may have your script resistive against another active windows. and it's possibe to run such script from scheduler on locked Windows station. I'm having this exact problem. When my workstation locks the script no longer finds the window I am looking for. I am using WinActivate to activate the window and continue on with these if/then statements, and WinWait to make sure the window exists before the script runs. What is the alternative for this so the script functions when the workstation is locked? Link to comment Share on other sites More sharing options...
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 account
Already have an account? Sign in here.Sign In Now