AutoHotkey Community

It is currently May 27th, 2012, 1:31 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 21 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: November 20th, 2009, 10:08 am 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
Flight4birds wrote:
... when the text "MX55/29 Nov" does exist, it is clicked.
... search for a whole set of text?
This should work:
Code:
COM_Init()
innerText = MX55/29 Nov | FD42/28 Nov | GW88/26 Nov ; put a "|" between items

F1::
   pwb:=iWeb_getwin("External Launch")
   code := "javascript: y=0,all=document.all[8].contentWindow.document.all[15].contentWindow.document.all; for(i=0;i<all.length;i++){T=all[i].innerText;if(T=='" RegExReplace(innerText," *\| *","'||T=='") "'){y=i;break}}; void 0"
   COM_Invoke(pwb, "Navigate", code)
   If index := COM_Invoke(pwb, "document.parentWindow.y")
      COM_Invoke(pwb,"document.all[8].contentwindow.document.all[15].contentwindow.document.all[" index "].click")
   COM_Release(pwb), COM_Term()
Return

I would, however, work on getting tank's example to work, considering the javascript line is getting long (especially if you have a lot of search items). Only so much javascript can me executed in one line like this.

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 20th, 2009, 11:33 pm 
Offline

Joined: March 6th, 2008, 11:54 pm
Posts: 167
thanks Jethrow that worked. I'll try to keep plugging away at tank's example. For some reason though with this web page, I've only had luck with the javascript infused examples.
There is some lag on the click as well, maybe 2 seconds or so. Which is fine, I think that could be one the negatives about using this type as opposed to Tank's.

thanks again for all your help.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 21st, 2009, 12:36 am 
Offline

Joined: March 6th, 2008, 11:54 pm
Posts: 167
@tank, not sure what you mean by "A" tag.

under this web page I can get this code to work
Code:
F1::
COM_Init()
   pwb:=iWeb_getwin("External Launch")
   iWeb_clickDomObj(pwb,"save","8,15")
   COM_Release(pwb), COM_Term()
Return

and this one
Code:
F1::
COM_Init()
   pwb:=iWeb_getwin("External Launch")
   iWeb_clickDomObj(pwb,"702","8,15")
   COM_Release(pwb), COM_Term()
Return


but am still unable to click the text in this one
Code:
F1::
COM_Init()
   pwb:=iWeb_getwin("External Launch")
   iWeb_clickText(pwb,"MX55/29 Nov","8,15")
   COM_Release(pwb), COM_Term()
Return

funny thing is, I hear a "click" noise when I run it, like the mouse tried to click something. Still nothing though.
Here's the text
Quote:
[innertext]=MX55/29 Nov

<TD class="Detail rightBorder Divider">MX55/29 Nov</TD>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 21st, 2009, 12:53 am 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
TD is a table element so that's not quite the information we're looking for (although it could be helpful). Is the link the image is associated with static (aka is it always the same)? Is it an actual link or a javascript call?

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 21st, 2009, 1:06 am 
Offline

Joined: March 6th, 2008, 11:54 pm
Posts: 167
It's a javascript call.
I figured you didn't need the table element, I just thought I'd give whatever was in the text of an element box.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 21st, 2009, 4:32 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
sinkfaze wrote:
TD is a table element so that's not quite the information we're looking for (although it could be helpful). Is the link the image is associated with static (aka is it always the same)? Is it an actual link or a javascript call?
actually it explains everything
:twisted:
jethros javascript cycles thru all objects wehre as mine only looks at links this is why the numeric iteration works yet the clicktext doesnot

you would need to create your own routine using COM to click that text

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: bobbysoon, iDrug, Ohnitiel, Yahoo [Bot] and 20 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group