Rad Posted July 25, 2006 Share Posted July 25, 2006 (edited) Trying to get my program to type what it says in the box in whatever window you have selected, this is how I've been doing it. I was it so it types it in, theres already a second way to use the Clipput and paste$Next = "This is my string" For $i=0 to StringLen($Next) Send("{" & StringMid($Next,$i,1) & "}") NextThis returns "Thisismystring" ... the spaces dont work. I tried modifying it a bit:$Next = "This is my string" For $i=0 to StringLen($Next) If StringMid("$next",$i,1) <> " " Then Send("{" & StringMid($Next,$i,1) & "}") Else Send("{SPACE}") Endif NextThis returns "This__________" (with a bunch of spaces). For some reason the first time it hits a space it will do spaces after that even if it isnt . I tried mixing it up, doing = " " then swapping the then/else around. Same thing occured.I dont really know how to do this... spaces arent working! >< Edited July 25, 2006 by Rad Link to comment Share on other sites More sharing options...
MHz Posted July 25, 2006 Share Posted July 25, 2006 The curly braces have a special meaning to Send and is interfering with your output. You can use the optional parameter for Send to send raw characters to eliminate the problem. As you see, no space problem here $Next = "This is my string" For $i = 1 to StringLen($Next) Send(StringMid($Next,$i,1)) Next oÝ÷ Ù.Ê{mÚ«jgz¸§IéÝjëh×6 $Next = "This is my string" For $i=0 to StringLen($Next) Send("{" & StringMid($Next,$i,1) & "}", 1) Next Link to comment Share on other sites More sharing options...
Rad Posted July 25, 2006 Author Share Posted July 25, 2006 (edited) As they say at little ceasers, thank you thank you! lol it works What about determining what GUICtrl you have active? :s Edited July 25, 2006 by Rad Link to comment Share on other sites More sharing options...
MHz Posted July 25, 2006 Share Posted July 25, 2006 Look in the Helpfile for GuiCtrlGetState Link to comment Share on other sites More sharing options...
Rad Posted July 25, 2006 Author Share Posted July 25, 2006 (edited) $GUI_FOCUS Control will be given input focus That it? >_> or does that mean it will select it? either will work actually Another thing thats kinda wierd, I got a loop for the delay between messages, but they seem to stack up, and when you click "Stop" nothing happens, and "Stop" turns to start when you click it. It queues when you push 'Stop', so when you push it more than once, when it catches up it will stop, then start, and repeat for each time u pushed it. What should I do? I was thinking of splitting up the delay this is what its like: If $Method = "Type" Then For $i=0 to StringLen($Next) Send(StringMid($Next,$i,1), 1) Next Send("{ENTER}") [b]Sleep($Delay)[/b] Endif and i was thinking like this: If $Method = "Type" Then For $i=0 to StringLen($Next) Send(StringMid($Next,$i,1), 1) Next Send("{ENTER}") [b]For $r=0 to 100 Sleep($Delay / 100) Next[/b] Endif I havent tried this yet, but think it will help clean it up? Any other suggestions? BTW Splitting the delay I was hoping it would catch $msg = $InputStart inside the loop.. this correct? Edited July 25, 2006 by Rad Link to comment Share on other sites More sharing options...
MHz Posted July 25, 2006 Share Posted July 25, 2006 It is a Gui right?, so set the state of the gui disabled, do the action, and then re-enable the Gui. You could even just do the state of the control if suitable. Look at: GUISetState and/or GUICtrlSetState. Link to comment Share on other sites More sharing options...
Rad Posted July 25, 2006 Author Share Posted July 25, 2006 Well I already disable the start/stop button, when you start theres a 3 second delay before it starts doing the command (so you can select your field before it starts), and I made it delay for 1500ms when u push Stop. It still mashes it after the 1.5s delay though, and I have no idea why >_> And the loop sleep didnt work, I guess I have to let it loop the entire thing to work. Ill mess with that a bit 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