Search text [Ctrl +] & Click on the highlighted text & repea

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
oracledba
Newbie
Posts: 3
Joined: Sun Mar 22, 2015 2:15 am

Search text [Ctrl +] & Click on the highlighted text & repea

Post by oracledba » Sun Mar 22, 2015 2:21 am

I have been searching for more than 2 days now to get some basic idea.

All I have to do is:1. Focus the window
2. Search: CTRL + F and enter the text "Go To" and press Enter
3. Move the mouse over to the highlighted text and Left Click

or

4. Click on the highlighted text .. if there is a direct way

and repeat the loop again.

Can you guys help me how to achieve this ? I have tried various functions unsuccessfully. Thanks!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Search text [Ctrl +] & Click on the highlighted text & r

Post by Marcus Tettmar » Mon Mar 23, 2015 2:40 pm

Hi,

Focusing the window and simulating a ctrl+f to find the text is the easy bit.

The problem is that there isn't really a way to discover the location of the highlighted text and click on it.

Of course a lot depends on the app, but in my experience there is no real way of doing this.

Perhaps we need to look at this another way. What is it you are trying to achieve? What application are you working with? Once the text is found what do you want to do with it?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

oracledba
Newbie
Posts: 3
Joined: Sun Mar 22, 2015 2:15 am

Re: Search text [Ctrl +] & Click on the highlighted text & r

Post by oracledba » Sat Mar 28, 2015 3:15 am

Application is Internet Explorer.

I would like to left click on the highlighted text.

mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Re: Search text [Ctrl +] & Click on the highlighted text & r

Post by mightycpa » Sat Mar 28, 2015 3:41 am

I did this using IE on your post. I searched for the word Click.

this is what I saw:

Image

The first entry was a particular blue. When I clicked it, the only thing that happened was that it turned yellow. I tried this over and over with different words, and it always acted the same, which makes me wonder why you'd want to click, but anyway, couldn't you use this command

FindImagePos>needle_bitmap,haystack,tolerance,return_offset,X_Array,Y_Array,NumFound[,MatchAlgorithm]

to find a little sliver of those colors? I know it wouldn't be foolproof, but what are the chances that your webpage uses those precise colors? You could probably test for those colors, then disable web page colors if you find them. There's a setting for that, I think.

It's late, or I'd try it myself.
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

oracledba
Newbie
Posts: 3
Joined: Sun Mar 22, 2015 2:15 am

Re: Search text [Ctrl +] & Click on the highlighted text & r

Post by oracledba » Sun Mar 29, 2015 4:33 am

Well, I am trying to find hyperlinks using Ctrl F.. and move over it and left click.. Any suggestions are of great help!!!! thx

mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Re: Search text [Ctrl +] & Click on the highlighted text & r

Post by mightycpa » Sun Mar 29, 2015 6:16 pm

Well, do you need to show the action on the screen? If not, you could do

HTTPRequest>

and then parse the result, and create an array of URL's from the anchor tags you find that contain the word "Click", for example, along with the URL.

Then, you could launch or HTTPRequest those pages, depending on what you want to do next.

If you do need to show the action, I guess you could fake it, and just paste the URL in the browser, or launch a new browser window with each URL that you find in the HTTPRequest.

I'm sure you could also do the same with WebRecorder, if you have it, although I personally find working with it difficult. I'm not very familiar with the objects and it is always a struggle for me to do it right. That said, if you can work with its syntax, then I'm sure it will work for you.
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Search text [Ctrl +] & Click on the highlighted text & r

Post by Marcus Tettmar » Mon Mar 30, 2015 12:13 pm

To find hyperlinks (Anchor tags) in IE you don't need to use find/replace. Use the IE functions. E.g. use IEGetTags to get an array of all 'A' tags. IEClick will "Click" them. You don't need to mouse over them.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts