 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Hannibal_32
Joined: 15 May 2009 Posts: 14 Location: Tulsa, OK
|
Posted: Fri May 15, 2009 3:56 pm Post subject: Locating text and repositioning on it |
|
|
Hey guys.. Not sure if this is possible. I searched through the archives and could not find the answers, so here I am.
I would like to sort through a lot of data in a website and find AND goto a specific word. I think I can locate the text with a WinGetText function, but I am not sure how I can scroll the page down to it. The purpose for this is to aid technicians reading telecom designs that are in an engineering layout. There is a specific section that the techs need in order to build out the logical designs.
I would like for them to be able to hit F6 and have AHK find the word "Logical" and then automatically scroll the page down so that Logical is on the top of the page. This would save them from sorting through a ton of irrelevant information.
Thanks for the help..
H |
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 5043 Location: the tunnel(?=light)
|
Posted: Fri May 15, 2009 4:48 pm Post subject: |
|
|
Yuck...I hate those TridentDlgFrame boxes. I don't know if AHK can necessarily search the page itself but you could speed up the way IE searches it with AHK. For example:
| Code: | F6::
SendMessage, 0x111, 67, 0, Internet Explorer_Server1, A ; opens the 'Find on this Page...' dialog box
WinWait, Find ; waits for the box to exist
Send {ALTDOWN}f{ALTUP} ; sends focus to the 'Find' field
Send Logical ; sends the text to the 'Find' field
Send{ALTDOWN}n{ALTUP} ; hits 'Next'
Send{ALTDOWN}{F4}{ALTUP} ; closes the 'Find on this Page...' dialog box
return |
And you can of course condense all of the Sends to one statement:
| Code: | F6::
SendMessage, 0x111, 67, 0, Internet Explorer_Server1, A
WinWait, Find
Send {ALTDOWN}f{ALTUP}Logical{ALTDOWN}n{ALTUP}{ALTDOWN}{F4}{ALTUP}
return |
Hope that helps. _________________ Try Quick Search for Autohotkey or see the tutorial for newbies. |
|
| Back to top |
|
 |
Hannibal_32
Joined: 15 May 2009 Posts: 14 Location: Tulsa, OK
|
Posted: Fri May 15, 2009 5:02 pm Post subject: |
|
|
I was hoping to not have to launch the typical find path, but it works well enough with your method. The only problem is that I want it to send {PgDn} after the find window is destroyed, but for some reason it won't work. Any ideas?
| Code: |
F6::
SendMessage, 0x111, 67, 0, Internet Explorer_Server1, A
WinWait, Find
Send Logical{enter}
sleep 100
Send {ALTDOWN}{F4}{ALTUP}
Send {PgDn}
return |
Thanks as always, sinkfaze..
H |
|
| Back to top |
|
 |
ManaUser
Joined: 24 May 2007 Posts: 1121
|
Posted: Fri May 15, 2009 5:03 pm Post subject: |
|
|
Is there any reason you can't do this through the browser's built-in text find feature? For instance in Firefox, you could just:
|
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 5043 Location: the tunnel(?=light)
|
Posted: Fri May 15, 2009 5:08 pm Post subject: |
|
|
I haven't found any good way to use anything other than the built-in search for IE but this method makes it work pretty quick. Might try this:
| Code: | F6::
SendMessage, 0x111, 67, 0, Internet Explorer_Server1, A
WinWait, Find
Send Logical{enter}
sleep 100
Send {ALTDOWN}{F4}{ALTUP}
WinWaitClose, Find
Send {PgDn} ; or optionally "ControlSend, , {PgDn}, A"
return |
_________________ Try Quick Search for Autohotkey or see the tutorial for newbies. |
|
| Back to top |
|
 |
Hannibal_32
Joined: 15 May 2009 Posts: 14 Location: Tulsa, OK
|
Posted: Fri May 15, 2009 5:23 pm Post subject: |
|
|
Okay.. Your last method worked the best. I tried a combination of WinClose and some sleep values, but the WinWaitClose works most of the time. For some reason the Find window doesn't close out about 1 of 5 tries, which results in the pgdn not being sent until it's manually closed, but it's still a vast improvement over just using Alt+F5, typing it out, hitting enter, closing the window, and hitting pg dn. (That was to answer the previous query)..
Like I said, it hangs up about 20% of the time, but I can live with that.
| Code: |
F6::
SendMessage, 0x111, 67, 0, Internet Explorer_Server1, A
WinWait, Find
Send Logical{enter}
sleep 200
Send {ALTDOWN}{F4}{ALTUP}
WinWaitClose, Find
Send {PgDn}
return
|
Thanks again, Sinkfaze!
H |
|
| 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
|