Hello, this is my first posting so I hope it has not been discussed before.
I was wondering if there is an easy way of getting the x,y mouse cursor position of the start of some text once it has been located using Text Find (Ctrl-F) in Internet Explorer.
Thanks
Getting x,y position of text after doing Text Find in IE6
Moderators: JRL, Dorian (MJT support)
-
- Newbie
- Posts: 2
- Joined: Fri Jan 30, 2004 1:19 pm
- Location: Australia
- Contact:
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Try using GetCursorPos function. This returns the X and Y coordinates of the current cursor position. X and Y are variables in which to store the coordinates.
Just a note that you might need to have Explorer window maximized or you may end up with relative values. Something like this:
Note that syntax on Let, Run Program, Find are not correct, just here for quick example of how to use them.
Just a note that you might need to have Explorer window maximized or you may end up with relative values. Something like this:
==================================Let>RP_WINDOWMODE=3 before running MSIE to maximize the window.
Run Program> MSIE
WaitWindowOpen>WebPage*
SetFocus>WebPage*
Find.....text.
GetCursorPos>X,Y
.....
.....
WaitWindowClosed>WebPage*
Let>RP_WINDOWMODE=1 (to return to normal mode)
Note that syntax on Let, Run Program, Find are not correct, just here for quick example of how to use them.
Last edited by Bob Hansen on Sat Jan 31, 2004 10:55 pm, edited 1 time in total.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
-
- Newbie
- Posts: 2
- Joined: Fri Jan 30, 2004 1:19 pm
- Location: Australia
- Contact:
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Aha, I understand. Good problem, gotta think about that one some more.
Don't know what you are going to do when you get there, but if need to do something like CTL-C to copy, have you considered doing View, Source on the web page, and then doing your search with something like TextPad? When TextPad finds a match, the cursor goes to the selection that is matched.
I use TextPad daily with Macro Scheduler to perform all types of Sensible Solutions. My two favorite utilities.
Macro Scheduler could open the view source, Select All, Copy to clipboard, open TextPad, Paste from clipboard, do Find, Get postion of mouse, and continue to copy/paste somewhere, continue from that point, save results, close TextPad and close MSIE when all done.

I use TextPad daily with Macro Scheduler to perform all types of Sensible Solutions. My two favorite utilities.
Macro Scheduler could open the view source, Select All, Copy to clipboard, open TextPad, Paste from clipboard, do Find, Get postion of mouse, and continue to copy/paste somewhere, continue from that point, save results, close TextPad and close MSIE when all done.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
Isn't that coincidental, you are working on similar problem as mine located at the recent title post:Acess no name forms via script.
Study my notes and it may help you.
Is the page you are searching framed or not.
If it is not framed, once you alt e f and enter the text to find, once the found text is highlighted you can give the command Press Tab and that will move the cursor to the location of the hilited text. Now that the cursor has jumped to the found text it is a simple solution to ask for the x,y positon of the text. Tab may cause the cursor to go to the end of the found text, but you can subtract the # of characters in the found text to get the start point.
However if the page is framed as in my example at ACESS NO NAME FORMS VIA SCRIPT... then when you command Tab, the cursor jumps to the first form field on the page and won't jump to the highlighted text.
Let me know if this helps, and if you study my problem and have any ideas, I would love to hear them.
I really believe this is your solution (at least if not framed) so if you don't thoroughly understand what I am saying, let me know and I will try to explain in another way.
Tom
Study my notes and it may help you.
Is the page you are searching framed or not.
If it is not framed, once you alt e f and enter the text to find, once the found text is highlighted you can give the command Press Tab and that will move the cursor to the location of the hilited text. Now that the cursor has jumped to the found text it is a simple solution to ask for the x,y positon of the text. Tab may cause the cursor to go to the end of the found text, but you can subtract the # of characters in the found text to get the start point.
However if the page is framed as in my example at ACESS NO NAME FORMS VIA SCRIPT... then when you command Tab, the cursor jumps to the first form field on the page and won't jump to the highlighted text.
Let me know if this helps, and if you study my problem and have any ideas, I would love to hear them.
I really believe this is your solution (at least if not framed) so if you don't thoroughly understand what I am saying, let me know and I will try to explain in another way.
Tom