ljkkda Posted November 18, 2005 Posted November 18, 2005 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 ?.? Quote $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
w0uter Posted November 18, 2005 Posted November 18, 2005 instead of using send maby you could try ControlSend ? My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
ljkkda Posted November 18, 2005 Author Posted November 18, 2005 (edited) if i use ControlSend it wont send any text if i opened a window or not Quote $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 November 18, 2005 by ljkkda
MHz Posted November 18, 2005 Posted November 18, 2005 "$window"Do not directly wrap quotes around a variable. You are then only using a string called "$window" rather then it's value.
ljkkda Posted November 18, 2005 Author Posted November 18, 2005 (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 November 18, 2005 by ljkkda
dabus Posted November 18, 2005 Posted November 18, 2005 (edited) Little question: Why would you want to write text into random windows? 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 November 18, 2005 by dabus
ljkkda Posted November 18, 2005 Author Posted November 18, 2005 (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 November 18, 2005 by ljkkda
Buffo Posted November 20, 2005 Posted November 20, 2005 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
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