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 

copying text from TitleMatchMode

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





PostPosted: Wed Mar 17, 2010 3:52 pm    Post subject: copying text from TitleMatchMode Reply with quote

have a window that shows needed text in this section of window spy

>>>>>>>>>>>( Visible Window Text )<<<<<<<<<<<
something a
something b

>>>>( TitleMatchMode=slow Visible Text )<<<<
something aa
something bb
something i need abc
something i need abcd

searching forum i put together this, but it copies from the Visible window text section... not the titlematchmode where i need...

Code:
SetTitleMatchMode, 2
SetTitleMatchMode, slow
DetectHiddenText, On
WinActivate, ahk_class TFrm_Parent
send ^p
;-----
WinGetText, tVar, ahk_class TFrm_Parent
Loop, Parse, tVar, `n, `r ; parses variable tVar by newline
{
if A_Index = 2
  Clipboard:=A_LoopField ; saves the second line to Clipboard
else if A_Index > 2
  break
}
VarSetCapacity(tVar,0) ; frees data from variable tVar

;--------
msgbox %clipboard%


actually need 3rd line up from the bottom
Back to top
maxgohan



Joined: 09 Oct 2009
Posts: 81

PostPosted: Wed Mar 17, 2010 4:19 pm    Post subject: Reply with quote

paste the tvar return here and we'll see,
just add the following in there somewhere and run it...

Quote:

clipboard = %tvar%
Back to top
View user's profile Send private message
wooly_sammoth



Joined: 12 May 2009
Posts: 634
Location: Gloucester UK

PostPosted: Wed Mar 17, 2010 4:22 pm    Post subject: Reply with quote

Try running this and see if the text you are after appears at all.
My gut tells me that the problem is with the break command if A_Index > 2

Code:
SetTitleMatchMode, 2
SetTitleMatchMode, slow
DetectHiddenText, On
WinActivate, ahk_class TFrm_Parent
send ^p
;-----
WinGetText, tVar, ahk_class TFrm_Parent
Loop, Parse, tVar, `n, `r ; parses variable tVar by newline
{
MsgBox, %A_Index% = %A_LoopField%
}


If the text you require shows in the message box use the A_Index number shown in the message box in your original script
Back to top
View user's profile Send private message Visit poster's website
willie599
Guest





PostPosted: Wed Mar 17, 2010 4:50 pm    Post subject: Reply with quote

i put the tvar in clipboard,
and yea...
it was there, but different order than Windowspy...

thanks!
Back to top
willie599
Guest





PostPosted: Wed Mar 17, 2010 5:37 pm    Post subject: Reply with quote

great...
it seems the thing varies

how do i look for a tvar that equals text "case active" and then copy the 3rd line below that...

i tried
Code:
Loop, Parse, tVar, `n, `r ; parses variable tVar by newline
{
if tVar = Case Active ;A_Index = 19
  clipboard = %A_Index%
  ;Clipboard:=A_LoopField ; saves the second line to Clipboard
else if A_Index > 20
  break
}


tried if %tvar% and also tried = "case active"
it errors "dynamic variable name is too long" ...?
Back to top
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