Sign in to follow this  
Followers 0
myname1

Running this script in the background?

12 posts in this topic

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. :P

Share this post


Link to post
Share on other sites



#3 ·  Posted (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 by myname1

Share this post


Link to post
Share on other sites

If Not WinActive("Window X","") Then WinActivate("Window X","")
ControlSend("Window X","","","test")


TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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.

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

That script do exactly the same job as my first script. It's not running in the background. Thanks anyway for the script. :P

I look up the search and see that there is somekind of "@SW_HIDE" feature. How I can use this?

Edited by myname1

Share this post


Link to post
Share on other sites

#6 ·  Posted (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? :P

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).

:idea:

Edited 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

Share this post


Link to post
Share on other sites

#7 ·  Posted (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 by myname1

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#10 ·  Posted (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 by Manadar

Share this post


Link to post
Share on other sites

I think this case is solved now. Thank you for your script, Manadar. That worked fine. :P

Share this post


Link to post
Share on other sites

I think this case is solved now. Thank you for your script, Manadar. That worked fine. :P

Don't forget to thank everyone else. They did all the hard work. 8)

Share this post


Link to post
Share on other sites

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

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0