 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
willie599 Guest
|
Posted: Wed Mar 17, 2010 3:52 pm Post subject: copying text from TitleMatchMode |
|
|
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
|
Posted: Wed Mar 17, 2010 4:19 pm Post subject: |
|
|
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 |
|
 |
wooly_sammoth
Joined: 12 May 2009 Posts: 634 Location: Gloucester UK
|
Posted: Wed Mar 17, 2010 4:22 pm Post subject: |
|
|
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 |
|
 |
willie599 Guest
|
Posted: Wed Mar 17, 2010 4:50 pm Post subject: |
|
|
i put the tvar in clipboard,
and yea...
it was there, but different order than Windowspy...
thanks! |
|
| Back to top |
|
 |
willie599 Guest
|
Posted: Wed Mar 17, 2010 5:37 pm Post subject: |
|
|
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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|