myname1 Posted October 21, 2008 Share Posted October 21, 2008 Hello. I need to run this script in background, so it doesn't active the window at all but do the typing job. If Not WinActive("Window X","") Then WinActivate("Window X","") Send("test") Please, help me. Link to comment Share on other sites More sharing options...
dbzfanatic Posted October 21, 2008 Share Posted October 21, 2008 Use ControlSend(). Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
myname1 Posted October 21, 2008 Author Share Posted October 21, 2008 (edited) It gives me syntax error: "ERROR: ControlSend() [built-in] called with wrong number of args."? If Not WinActive("Window X","") Then WinActivate("Window X","") ControlSend("test") Edited October 21, 2008 by myname1 Link to comment Share on other sites More sharing options...
bogQ Posted October 21, 2008 Share Posted October 21, 2008 If Not WinActive("Window X","") Then WinActivate("Window X","") ControlSend("Window X","","","test") TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
myname1 Posted October 22, 2008 Author Share Posted October 22, 2008 (edited) That script do exactly the same job as my first script. It's not running in the background. Thanks anyway for the script. I look up the search and see that there is somekind of "@SW_HIDE" feature. How I can use this? Edited October 22, 2008 by myname1 Link to comment Share on other sites More sharing options...
PsaltyDS Posted October 22, 2008 Share Posted October 22, 2008 (edited) That script do exactly the same job as my first script. It's not running in the background. Thanks anyway for the script. I look up the search and see that there is somekind of "@SW_HIDE" feature. How I can use this?Where's the C.O.P. bot when you need it? Run the basic tutorials in the help file so you will have some foundation in selecting windows and controls. ControlSend() does not absolutely require you to ID the control, but you won't necessarily know where the data went if you don't.WinSetState() will allow you minimize or hide the window (see the help file). Edited October 22, 2008 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
myname1 Posted October 24, 2008 Author Share Posted October 24, 2008 (edited) Hello. Thanks for telling me that "WinSetState" thing. Okay. Now the script hide the activated window but it's still visible when the script is doing the keystroke job (ControlSend). How I can run the keystrokes also in the background? If Not WinActive("Window X","") Then WinActivate("Window X","") WinSetState("Window X","",@SW_HIDE) If Not WinActive("Window X","") Then WinActivate("Window X","") ControlSend("Window X","","","test") If Not WinActive("Window X","") Then WinActivate("Window X","") WinSetState("Window X","",@SW_SHOW) Edited October 24, 2008 by myname1 Link to comment Share on other sites More sharing options...
martin Posted October 24, 2008 Share Posted October 24, 2008 Hello. Thanks for telling me that "WinSetState" thing. Okay. Now the script hide the activated window but it's still visible when the script is doing the keystroke job (ControlSend). How I can run the keystrokes also in the background? If Not WinActive("Window X","") Then WinActivate("Window X","") WinSetState("Window X","",@SW_HIDE) If Not WinActive("Window X","") Then WinActivate("Window X","") ControlSend("Window X","","","test") If Not WinActive("Window X","") Then WinActivate("Window X","") WinSetState("Window X","",@SW_SHOW) WinSetState("Window X","",@SW_HIDE) ControlSend("Window X","","","test") sleep(2000);just a delay to simulate some other processes WinSetState("Window X","",@SW_SHOW) Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
myname1 Posted October 24, 2008 Author Share Posted October 24, 2008 Thanks for reply but that delay doesn't work either. Here's the complete example script: If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","") WinSetState("Untitled - Notepad","",@SW_HIDE) If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","") ControlSend("Untitled - Notepad","","","{CTRLDOWN}a{CTRLUP}Some{SPACE}text.") sleep(2000) MouseMove(491,408) MouseDown("left") MouseUp("left") If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","") WinSetState("Untitled - Notepad","",@SW_SHOW) All other things are working (running in background) but I still see mouse moving. Link to comment Share on other sites More sharing options...
jvanegmond Posted October 24, 2008 Share Posted October 24, 2008 (edited) If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","") WinSetState("Untitled - Notepad","",@SW_HIDE) If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","") ControlSend("Untitled - Notepad","","","{CTRLDOWN}a{CTRLUP}Some{SPACE}text.") sleep(2000) ControlClick("Untitled - Notepad","", "", "Left", 1, 491,408) If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","") WinSetState("Untitled - Notepad","",@SW_SHOW) Please tell us what you're trying to do. Automating notepad is useless. Edited October 24, 2008 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
myname1 Posted October 24, 2008 Author Share Posted October 24, 2008 I think this case is solved now. Thank you for your script, Manadar. That worked fine. Link to comment Share on other sites More sharing options...
jvanegmond Posted October 24, 2008 Share Posted October 24, 2008 I think this case is solved now. Thank you for your script, Manadar. That worked fine. Don't forget to thank everyone else. They did all the hard work. 8) github.com/jvanegmond 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