Sign in to follow this  
Followers 0
ljkkda

wont write

8 posts in this topic

ok i made this script to write some text in a hided window "($window)" after a specified time... and then go back to the last window where i was active "($window2)" ...

the problem is if i have no window activated (im only on desktop) the script wont write in the window "($window)" !

but if a have any window opened like explorer , txt editor ore something it works...!!

whats wrong here ?.?

$window = WinGetTitle("")

$window2 = WinGetTitle("")

while $window2 = WinGetTitle("")

winactivate ($window)

ControlClick ( $window, "", 1 , "LEFT" , 1 )

send ("SOME TEXT")

send ("{Enter}")

WinSetState($window, "" , @SW_hide)

winactivate ($window2)

sleep (900000)

$window2 = WinGetTitle("")

winactivate ($window)

ControlClick ( $window, "", 1 , "LEFT" , 1 )

send ("SOME TEXT")

send ("{Enter}")

winactivate ($window2)

sleep (900000)

wend

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

if i use ControlSend it wont send any text if i opened a window or not

$window = WinGetTitle("")

$window2 = WinGetTitle("")

while $window2 = WinGetTitle("")

winactivate ($window)

ControlSend ( "$window", "", 1, "SOME TEXT" )

WinSetState($window, "" , @SW_hide)

winactivate ($window2)

sleep (900000)

$window2 = WinGetTitle("")

winactivate ($window)

ControlSend ( "$window", "", 1, "SOME TEXT" )

winactivate ($window2)

sleep (900000)

wend

Edited by ljkkda

Share this post


Link to post
Share on other sites

"$window"

Do not directly wrap quotes around a variable. You are then only using a string called "$window" rather then it's value.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

ok now i use

ControlSend ( $window, "", 1, "SOME TEXT" )

and it wont send... it send only if i make a mouseclick on the edit box.

the same effect if i use this

ControlSend ( $window, "", "Edit1", "SOME TEXT" )

Edited by ljkkda

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Little question:

Why would you want to write text into random windows? B)

And why do you want to activate a hidden window ( you don't need that with controlsend ) ?

Someting like a textfile would make more sense to me.

Edited by dabus

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

i wont write in random windows only ONE window then press ENTER and then go back to the last activate window... and this many times!

and i want that the window is hidden because i hate the "window jungle" in the "task-leiste" sorry i dont know the english word for this...

Edited by ljkkda

Share this post


Link to post
Share on other sites

Hi there

If I try "ControlSend"or to a hidden MMC-console-window it becomes visible immediately.

Is that only for me or can you confirm this behaviour? Other windows work correct.

I use the latest Beta.

Regards,

Buffo

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