AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Waiting until long string has FINISHED pasting

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
hardcider09



Joined: 26 Mar 2009
Posts: 15

PostPosted: Thu Dec 17, 2009 2:43 am    Post subject: Waiting until long string has FINISHED pasting Reply with quote

I'm pasting a variable (using SendInput) into the field of a program, and sometimes the variable is long and the field takes awhile before all the text is accepted.


Is there a way AHK can figure out when it's done?
Back to top
View user's profile Send private message
TLM



Joined: 21 Aug 2006
Posts: 2926
Location: The Shell

PostPosted: Thu Dec 17, 2009 2:58 am    Post subject: Reply with quote

look at ControlGetTxt..
_________________
paradigm.shift:=(•_•)┌П┐RTFM||^.*∞
Back to top
View user's profile Send private message
hardcider09



Joined: 26 Mar 2009
Posts: 15

PostPosted: Thu Dec 17, 2009 1:34 pm    Post subject: Reply with quote

Would I use ControlGetText to compare the text of the control to the variable I'm pasting and when they both are the same, I know the variable was finished being pasted?
Back to top
View user's profile Send private message
SlowMotion
Guest





PostPosted: Thu Dec 17, 2009 1:39 pm    Post subject: Reply with quote

ClipBoard := MyVar
SendInput, ^v
Back to top
hardcider09



Joined: 26 Mar 2009
Posts: 15

PostPosted: Thu Dec 17, 2009 1:52 pm    Post subject: Reply with quote

That's what I ended up doing. I found that pasting the clipboard, i.e. {Control down}v{Control up} is much faster than SendInput, %MyVar%.

Still curious how I could use ControlGetText to figure out when the variable had been completely pasted....
Back to top
View user's profile Send private message
nulljector
Guest





PostPosted: Thu Dec 17, 2009 2:13 pm    Post subject: Reply with quote

Just an idea
Code:
; Works when My Computer is open.
F1::
var = My Computer
Loop,
{
   ControlGetText, conTxt, Edit1, My Computer
   if (var = conTxt)
      {
      Msgbox, % "The control contains the desired text."
      Break
      }
   Else
      {
      Msgbox, % "The control contains " conTxt "`nIts not the desire text."
      Break
   }
}

Return
Back to top
habdrom
Guest





PostPosted: Thu Dec 17, 2009 2:23 pm    Post subject: Reply with quote

hardcider09 wrote:
Would I use ControlGetText to compare the text of the control to the variable I'm pasting and when they both are the same, I know the variable was finished being pasted?

If the target control responds to ControlGetText, then why bother with either SendInput or the clipboard? Just use ControlSetText or Control, EditPaste, either of which are as fast as pasting the clipboard (and neither uses the clipboard). Check them out in the help file.
Back to top
hardcider09



Joined: 26 Mar 2009
Posts: 15

PostPosted: Thu Dec 17, 2009 6:40 pm    Post subject: Reply with quote

habdrom wrote:
If the target control responds to ControlGetText, then why bother with either SendInput or the clipboard? Just use ControlSetText or Control, EditPaste, either of which are as fast as pasting the clipboard (and neither uses the clipboard). Check them out in the help file.



I love it! I have only written a few scripts and haven't worked with "controls" yet, but now seems like the right time to start! Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group