MaxU77 Posted November 26, 2010 Share Posted November 26, 2010 I have created a script that is supposed to proceed in off-time. It is definetely not bullet proof one because the part of software script should interact with has no controls recognized with <Autoit Window Info>. Thus nothing I can do but go through softwares interface. I'm ve set hotkey (Ctrl+Shift+1) within the software itself that starts the window with controls for further process. Then I'm waiting for the window to appear. ....... Send ("^+1") WinWait ("....... When I run script manually - everything goes well and I'm getting the result I want. But in real usage it hangs on exact that place. When I go to office and unlock my PC I see autoit-sign in the tray. If I then press Ctrl+Shift+1 the window waited appears and script processes the rest of work just fine. The only difference I could imagine - PC is in the locked condition. And yes I can reproduce it by adding Sleep for a while in begining and locking PC just after running script manually. Is there any ways to fight this? Link to comment Share on other sites More sharing options...
Developers Jos Posted November 26, 2010 Developers Share Posted November 26, 2010 double check the WinWait parameters that you have exact information in there. It sounds like something changes after a few seconds when you say you can replicate the issue by putting a sleep between Send() and WinWait(). Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
MaxU77 Posted November 26, 2010 Author Share Posted November 26, 2010 double check the WinWait parameters that you have exact information in there. It sounds like something changes after a few seconds when you say you can replicate the issue by putting a sleep between Send() and WinWait().JosSorry. There is probably misunderstanding.I put sleep not "between ...." but at the begining of the script.I do it in order to have time to lock PC before the real action begin. Link to comment Share on other sites More sharing options...
Developers Jos Posted November 26, 2010 Developers Share Posted November 26, 2010 (edited) Sorry. There is probably misunderstanding. I put sleep not "between ...." but at the begining of the script. I do it in order to have time to lock PC before the real action begin. so you are sure it is hanging on the WinWait() ? To double check just add the following line at the top: Opt("TrayIconDebug", 1) .. and hover over the autoit trayicon to display the line the script is waiting for. Edited November 26, 2010 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
SadBunny Posted November 26, 2010 Share Posted November 26, 2010 Isn't this just a question of http://www.autoitscript.com/wiki/FAQ#Why_doesn.27t_my_script_work_on_a_locked_workstation.3F ? Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
MaxU77 Posted November 27, 2010 Author Share Posted November 27, 2010 (edited) Isn't this just a question of http://www.autoitscript.com/wiki/FAQ#Why_doesn.27t_my_script_work_on_a_locked_workstation.3F ? Now I almost sure it has direct relation to the FAQed question you've referenced. There is "frobidden" <WinActivate> in script before the issued place: ..... WinActivate ("AAA", "") Send ("^+1") WinWait ("....... Debug claims <WinWait> to be haging string After I've added <WinWaitActive> like ..... WinActivate ("AAA", "") WinWaitActive ("AAA", "") Send ("^+1") WinWait ("....... Things have changed a bit: Script still hangs but now it is enough to log-in to un-hang it (no need to press hotkey). All-in-all it is not exactly what I want. The software hotkey is the almost the only way I could imagine to get to the control that initiates the target child window. Pity there is no somewhat <WinSend> command in AutoIt. I quess the software I'm struggling with don't have command menu (It does have command menu, but that menu is probably not the standard windows object, also control which runs the child window is not in that menu, but it is rather drop-down option in some area that I'd call "auxiliary command menu") otherwise I'd use <WinMenuSelectItem>. I should probably need to try combination of Window Management and Mouse Management... Edited November 27, 2010 by MaxU77 Link to comment Share on other sites More sharing options...
SadBunny Posted November 27, 2010 Share Posted November 27, 2010 As the aforementioned FAQ states, when the station is locked no window will ever be active, so WinWaitActive will always "hang" on a locked station. When you unlock it, the window can be active again and if it is the script continues. So all in all, if your script actually depends on a window being active, it just won't work in a locked situation. You can send stuff to controls by ControlSend... Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
MaxU77 Posted November 29, 2010 Author Share Posted November 29, 2010 You can send stuff to controls by ControlSend...This works!Any window control can be used to send software hotkey to window. Thanks. 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