Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Example of Navigating a Website


  • Please log in to reply
14 replies to this topic
deleyd
  • Members
  • 64 posts
  • Last active: Sep 27 2011 06:35 AM
  • Joined: 08 Mar 2008
Example of Navigating a Website

Run the script WebsiteNav.ahk and see what happens (hopefully it works).

This demo requires the COM Standard library (COM.ahk):[*:1kx2oyoc]Download Com.zip from: <!-- m -->http://www.autohotke...ean/Lib/COM.zip<!-- m -->
if that link doesn't work then you may download from:
<!-- m -->http://www.daviddele...ean/Lib/COM.zip<!-- m -->
[*:1kx2oyoc]unzip and place COM.ahk here: C:\Program Files\AutoHotkey\Lib\COM.ahk
(See "COM Standard Library" post: <!-- m -->http://www.autohotke...topic22923.html<!-- m -->)This demo requires Internet Explorer to be the default browser.

This demo creates a log file named "WebsiteNav.txt" (in the same directory as the WebsiteNav.ahk script file)

This demo does:[*:1kx2oyoc]Goes to <!-- m -->http://www.autohotkey.com<!-- m -->
[*:1kx2oyoc]Moves focus to the "Wiki" link
[*:1kx2oyoc]Positions in the Search box of the Wiki page, fills it in
[*:1kx2oyoc]Searches horizontally for a non-white colorThis demo demonstrates:[*:1kx2oyoc]WAIT FOR WEBSITE PAGE TO FINISH LOADING[*:1kx2oyoc]Method 1: Wait for status line to say "Done"
[*:1kx2oyoc]Method 2: call IEReady() [Only works for Internet Explorer (afik)][*:1kx2oyoc]POSITION US ON A CERTAIN CONTROL[*:1kx2oyoc]Method 1. Blindly hit the {Tab} key a certain number of times to position us where we want to be (usually not very reliable).
[*:1kx2oyoc]Method 2. Hit the {Tab} key until certain text appears in the status bar
[*:1kx2oyoc]Method 3. Use ControlSetText and ControlSend to jump directly to the control (JavaScript method)[*:1kx2oyoc]SEARCH HORIZONTALLY(/OR VERTICALLY) FOR A SPECIFIC COLOR PIXEL[/list]Version 2.01 (05/29/2009)
Download from:
<!-- m -->http://www.daviddele... ... iteNav.ahk<!-- m -->

See also:
AutoHotKey Expression Examples: "" %% () and all that
<!-- m -->http://www.daviddele... ... amples.htm<!-- m -->



Or, here it is, all 408 lines:

/*************************************************    (Version 2.01  05/29/2009)
 Examples of various ways to Navigate a Web Site
 *************************************************

 This demo requires the COM Standard library (COM.ahk):
    1. Download Com.zip from:  http://www.autohotkey.net/~Sean/Lib/COM.zip
    2. unzip and place COM.ahk here:  C:\Program Files\AutoHotkey\Lib\COM.ahk
    (See "COM Standard Library" post: http://www.autohotkey.com/forum/topic22923.html)

 This demo creates a log file named "WebsiteNav.txt"
   (in the same directory as this .ahk script file)

 This demo does:
   1. Goes to www.autohotkey.com
   2. Moves focus to the "Wiki" link
   3. Positions in the Search box of the Wiki page, fills it in
   4. Searches horizontally for a non-white color


 1. SOME STARTUP STUFF
*/
;^z::                      ;press CTRL+Z to go. (Uncomment if you want script to wait until you press CTRL+Z)
#NoEnv                     ;Recommended for performance and compatibility with future AutoHotkey releases.
;;SendMode Input           ;I discovered this causes MouseMove to jump as if Speed was 0. (was Recommended for new scripts due to its superior speed and reliability.)
#SingleInstance force      ;Skips the message, "An older instance of this script is already running. Replace it with this instance?"
WinGet, SavedWinId, ID, A  ;Save our current active window
MouseGetPos, xpos, ypos    ;Save initial position of mouse (note: no %% because it's writing output to xpos, ypos)
SetKeyDelay, 60            ;Any number you want (milliseconds)
CoordMode,Mouse,Screen     ;Initial state is Relative
CoordMode,Pixel,Screen     ;Initial state is Relative. Frustration awaits if you set Mouse to Screen and then use GetPixelColor because you forgot this line. There are separate ones for: Mouse, Pixel, ToolTip, Menu, Caret
MouseMove, 0, 0, 0         ;Prevents the status bar from showing a mouse-hover link instead of "Done". (We need to move the mouse out of the way _before_ we go to a webpage.)

MsgBox, 0, demo, Press Esc to abort this script, 2.0

/*************************************************
  2. SET UP A LOG FILE
*/
SetWorkingDir, %A_ScriptDir%  ;Set default directory to where this script file is located
LogFile := "websiteNav.txt"
LogMsg(";--------------------------------------------------------------`n`nBEGIN EXAMPLE OF NAVIGATING WEBSITE:")


/*************************************************
  3. GO TO THE WEBSITE (AutoHotkey website for example)
     We could simply do:
     Run, http://www.autohotkey.com/ , , max
     but we want to make sure we use Internet Explorer for this,
     so we'll do this instead:
*/
run, iexplore.exe http://www.autohotkey.com/
WaitLoad("AutoHotkey")


/*************************************************
  4. POSITION US ON A CERTAIN CONTROL
     Examples from simple to more complex
*/
; Method 1. Blindly hit the {Tab} key a certain number of times to position us where we want to be.
;           Usually not very accurate.
Send {Tab 3}  ;say, 3 tabs gets us where we want to be.

; Method 2. Hit the {Tab} key until certain text appears in the status bar
; For example, Tab until we find the autoHotkey "Forum" link
; When we tab to the AutoHotkey "Forum" link, the status bar says "http://www.autohotkey.com/docs/"
target := "http://www.autohotkey.com/wiki/"
ShoMsg("{Tab} until we find the Wiki link: " . target, "3.0")
loop, 20
{
  Send, {Tab}
  sleep 10  ;this pause may help
  StatusBarGetText, StatBar, , AutoHotkey
  ShoMsg(" Loop=" . A_Index . "`nStatus bar = """ . StatBar . """", "0.3")
  if (StatBar = target)
  {
    ShoMsg("FOUND IT! Status bar = """ . target . """", "3.0" )
    goto F
  }
}
; If we drop out here, it means we failed to find our target
; I had a case where {TAB} just circled around the top where
; the Google toolbar was. It never made it into the actual page.
; Method 2.5
ShoMsg("Failed to find " . target . "`n`nLet's try tabbing backwards (shift-tab)", "3.1" )
SetKeyDelay, 40
Send +{Tab 20}   ;first a bunch of backward tabs to get us going
loop, 90
{
  Send, +{Tab}
  sleep 10  ;this pause may help
  StatusBarGetText, StatBar, , AutoHotkey
  ;ShoMsg(" Tabbing Backwards.`nLoop=" . A_Index . "`nStatus bar = """ . StatBar . """", "0.3")
  if (StatBar = target)
  {
    ShoMsg("FOUND IT TABBING BACKWARDS! Status bar = """ . target . """", "3.0" )
    goto F
  }
}

ExitApp


/*******************************************************
  5. CLICK ON THE LINK TO GO TO THE AUTOHOTKEY WIKI PAGE
*/
F:
;Found the AutoHotkey "wiki" link. Click on it (actually we just press {Return} key)
ShoMsg("{Return}", "2.0")
Send {Return}


/************************************************
  6. WAIT FOR NEW PAGE TO LOAD
     (Just as we did before)
*/
WaitLoad("AutoHotkey")

Sleep 1500  ;give the user a moment to see the new page


/********************************************************************
  7. POSITION US IN THE SEARCH FIELD OF THE AUTOHOTKEY WIKI PAGE
     Here we demonstrate a faster more complex technique,
     using ControlSetText and ControlSend

     The JavaScript method. We place some JavaScript code in the address
     bar and execute it to jump directly to the control. This is a
     faster and more reliable technique, but it's a bit more
     complicated to set up. We use AutoHotkey ControlSetText to
     place the JavaScript code in the address bar, specifying the
     HTML control ID, or the control NAME, of the control we want
     to jump to, then we use AutoHotkey ControlSend to execute
     that JavaScript.

     Determine the ID or NAME of the control
     Method 1: Read and decypher the HTML source code. Look for " ID="
               e.g. for page http://www.autohotkey.com/wiki/
               we find this line of code:

                   <INPUT id=searchInput title="Search AutoHotkey [f]" accessKey=f name=search>
                             ^^^^^^^^^^^                                                ^^^^^^
                   In this example our ID is "searchInput", and our NAME is "search" (we only need one, ID or NAME)

     Method 2: Use a tool to help us find the ID or NAME
               Use the Microsoft "Internet Explorer Developer Toolbar" for Internet Explorer 7
                    (Note: for Internet Explorer 8, see "Discovering Internet Explorer Developer Tools" at http://msdn.microsoft.com/en-us/library/cc848894(VS.85).aspx
                 a. Download and install : http://www.microsoft.com/downloads/details.aspx?familyid=E59C3964-672D-4511-BB3E-2D5E1DB91038&displaylang=en
                 b. Navigate to your webpage (using Internet Explorer 7)
                 c. Bring up the "IE Developer Toolbar". (Note: If you do not see the "IE Developer Toolbar" button on the toolbar, it may be off to the right. Click the right-facing arrows at the end of the IE7 command bar to view all available toolbar buttons.)
                 d. FIND -> SELECT ELEMENT BY CLICK
                 e. Move your mouse to the desired element and click.
                 f. In the middle pane ('Attribute:') scroll down and find the ID string.
                    If there is no ID string, find the NAME string.
                    If there is no NAME string, cripes, it gets a bit difficult. You'll
                      have to read up on Javascript and the DOM (Document Object Model).

                 There are other similar programs to help you examine the source code for web pages. Here are a few:
                 Debugbar http://www.debugbar.com/
                 PageSpy http://www.sembel.net/
*/

;DEMONSTRATE POSITIONING TO A CONTROL USING CONTROL'S ID
; warning: "getElementById" is case sensitive! I originally tried "getElementByID" (last leter "D" instead of "d") and it didn't work.
ShoMsg("Positioning to search box`nusing ID", "2.0")
ControlSetText, Edit1, javascript:document.getElementById( 'searchInput').focus()
ControlSend, Edit1, {Enter}, AutoHotkey
Sleep 100     ;give it a moment to do it's thing (important)
sleep 3000    ;(give the user a moment to see that we are now positioned in the search field)
ShoMsg("filling in search box", "2.0")
SetKeyDelay, 90
Send AutoHotkey Expression Examples
sleep 2000    ;(give the user a moment to see)
ShoMsg("Let's erase that", "2.0")
Send {Backspace 30}
sleep 2000    ;(give the user a moment to see)
/*
  Alternatively, if we didn't have an ID but did have a NAME,
  we could use the NAME (which in this example is "search")
*/
ShoMsg("moving away from search box", "2.0")
loop, 5
{
  Send {Tab}
  Sleep 400   ;just for show
}
sleep 2000    ;(give the user a moment to see that we are now positioned in the search field)


;DEMONSTRATE POSITIONING TO A CONTROL USING CONTROL'S NAME
ShoMsg("Positioning to search box`nusing NAME", "2.0")
ControlSetText, Edit1, javascript:document.getElementsByName( 'search')[0].focus()
ControlSend, Edit1, {Enter}, AutoHotkey
Sleep 100     ;give it a moment to do it's thing (important)
sleep 2000    ;(give the user a moment to see that we are now positioned in the search field)


;fill in the search field
ShoMsg("filling in search box", "2.0")
SetKeyDelay, 90
Send AutoHotkey Expression Examples
sleep 2000    ;(give the user a moment to see)
ShoMsg("{Return}", "2.0")
Send {Return}
WaitLoad()  ;and wait for the new page to load


/********************************************************************
  8. SEARCH FOR A COLOR

     If I'm searching a white background for black text, I find it
     works better to search for "not white" rather than search for
     "black", because sometimes that black text isn't really black
     when you look at it closely.

     This actually goes quite fast if you comment out the moving of
     the mouse. I move the mouse here for demonstration purposes.
*/
CoordMode,Mouse, Relative
CoordMode,Pixel, Relative
WinGetPos, winposX, winposY, Width, Height, A  ;Get window Width, Height
LogMsg("winposX=" . winposX . "`nwinposY=" . winposY . "`nWidth=" . Width . "`nHeight=" . Height)

;Calculate a starting position
X := Width - 60
Y := Height / 2
MouseMove, X, Y, 7

;Move left until we find a non-white pixel
ShoMsg( "Demonstrate moving left looking for a non-white pixel color", "2.0")
loop 1000
{
    MouseMove, X, Y, 0
    PixelGetColor, color, X, Y, RGB
    ;ShoMsg( "color= " . color, "0.1" )
    if (color <> "0xFFFFFF")
    {
      Goto FOUND_TCOLOR
    }
    X -= 1
}
;If we drop out here, it means we failed to find a non-white colored pixel
ShoMsg( "Failed to find a non-white color`n(This is just a demo)", "2.0" )
goto Exit


FOUND_TCOLOR:
ShoMsg( "Found a non-white color`npixel color = " . color, "2.0" )

Exit:
sleep 1000
ShoMsg( "End of Demonstration.", "4.0" )
ExitApp


;---END OF AUTO-EXECUTE CODE---------------------------------------------------
/******************************************************************************
  PRESS ESC TO CANCEL THIS SCRIPT
    A hotkey definition line stops execution at that point, so if you want the
    script to run to the end but have the ESC key available to terminate the script,
    put the hotkey definition at the end, just AFTER your ExitApp statement.
*/
Esc::ExitApp


/****************************************
  and now, some functions...
*/
;------------------------------------------------------------------------------
LogMsg( msg )
{
  global LogFile
  FormatTime, TimeString, , yyyy-MM-dd hh:mm:ss tt
  FileAppend, `n%TimeString% : %msg%, %LogFile%
  ;Note: I've had problems with heavy use of FileAppend. Sometimes it fails.
  ;You can check ErrorLevel, but can't get any further info on why it failed.
  ;FileAppend closes the file each time. That can be a lot of opening/closing.
}


/**********************************************************************
  ShoMsg
    I was debugging an AutoHotKey script by throwing in a bunch of MsgBox
    messages, and I discovered a problem that focus wasn't being returned
    to my window after the MsgBox timed out. So, I added a WinActivate
    after MsgBox to restore focus to my window, and all was well again.

    Update: I had another case where this was exactly the _wrong_ thing
            to do. (The "current window" wasn't the one I wanted.)
*/
ShoMsg( msg, Timeout = "" )
{
  LogMsg( msg )   ;might as well log the message too
  ;WinExist("A")   ;current window becomes "Last Found Window"
  MsgBox, 0, demo, %msg%, %Timeout%
  ;WinActivate     ;activate "Last Found Window" (precaution after using MsgBox)
}


/******************************************************************************
  WaitLoad - Wait For Website Page To Load

  DETERMINING WHEN A WEBPAGE HAS FINISHED LOADING:
    See FAQ: http://www.autohotkey.com/docs/FAQ.htm#load

    Method 1: Wait for status line to say "Done"

    Method 2: call IEReady()
    [Only works for Internet Explorer (afik).]
    See post "Determine if a WebPage is completely loaded in IE" : http://www.autohotkey.com/forum/topic19256.html
         1a. Download Com.zip from:  http://www.autohotkey.net/~Sean/Lib/COM.zip  ("COM Standard Library" post: http://www.autohotkey.com/forum/topic22923.html)
         1b. unzip and place COM.ahk here:  C:\Program Files\AutoHotkey\Lib\COM.ahk
         2a. Download function IEReady from:  http://www.autohotkey.com/forum/topic19256.html
         2b. Add fuction IEReady to your .ahk code
         3.  Place a call to IEReady() in your .ahk code when you want to wait until the page is loaded

     Method 3: See "Detect when a page is loaded (reliable, cross-browser)" post: http://www.autohotkey.com/forum/topic35056.html

     Methods 4,5,6,...
     For more advanced methods which are over my head, see these two posts:

       Automation IE7 Navigation and Scripting with Tabs
       http://www.autohotkey.com/forum/viewtopic.php?t=30599

       IE and Gui Browser Com Tutorial
       http://www.autohotkey.com/forum/viewtopic.php?t=34972


  Function : WaitLoad - Wait For Website Page To Load
  Input    : Window Title (optional)
*/
WaitLoad( WinTitle = "" )
{
  ShoMsg("Waiting for webpage to load...", "2.0")

  ; Wait for window title to appear (optional).
  ; Careful, the window title is case sensitive! 10 second timeout.
  IF (WinTitle <> "")
  {
    WinWaitActive, %WinTitle%, , 10
    if ErrorLevel
    {
       ShoMsg("Timeout waiting for window title " . WinTitle )
       ExitApp
    }
    ShoMsg("Waiting for webpage to load...`nFound window title """ . WinTitle . """", "2.0")
  }


  ; WAIT FOR WEB PAGE TO FINISH LOADING
  ; Test #1. Call IEReady (I think this only works for Internet Explorer?)
  IEReady()
  ShoMsg("Waiting for webpage to load...`nIEReady() says we're ready", "2.0")


  ; Test #2. Wait for "Done" to appear in browser status bar
  StatusBarWait, Done, 10
  if ErrorLevel
  {
     ShoMsg("Timed out waiting for ""Done"" to appear in status bar")
     ExitApp
  }
  ShoMsg("Waiting for webpage to load...`nFound ""Done"" in the status bar", "2.0")
  Return
}


/**********************************************************************
  IEReady()
    From post "Determine if a WebPage is completely loaded in IE" : http://www.autohotkey.com/forum/topic19256.html

    Requires the COM.ahk library:
       (See "COM Standard Library" post: http://www.autohotkey.com/forum/topic22923.html)
       1a. Download Com.zip from:  http://www.autohotkey.net/~Sean/Lib/COM.zip
       1b. unzip and place COM.ahk here:  C:\Program Files\AutoHotkey\Lib\COM.ahk
*/
IEReady(hIESvr = 0)
{
   If Not   hIESvr
   {
      Loop,   50
      {
         ControlGet, hIESvr, hWnd, , Internet Explorer_Server1, A ; ahk_class IEFrame
         If   hIESvr
            Break
         Else   Sleep 100
      }
      If Not   hIESvr
         Return   """Internet Explorer_Server"" Not Found."
   }
   Else
   {
      WinGetClass, sClass, ahk_id %hIESvr%
      If Not   sClass == "Internet Explorer_Server"
         Return   "The specified control is not ""Internet Explorer_Server""."
   }

   COM_Init()
   If   DllCall("SendMessageTimeout", "Uint", hIESvr, "Uint", DllCall("RegisterWindowMessage", "str", "WM_HTML_GETOBJECT"), "Uint", 0, "Uint", 0, "Uint", 2, "Uint", 1000, "UintP", lResult)
   &&   DllCall("oleacc\ObjectFromLresult", "Uint", lResult, "Uint", COM_GUID4String(IID_IHTMLDocument2,"{332C4425-26CB-11D0-B483-00C04FD90119}"), "int", 0, "UintP", pdoc)=0
   &&   pdoc && pweb:=COM_QueryService(pdoc,IID_IWebBrowserApp:="{0002DF05-0000-0000-C000-000000000046}")
      Loop
         If   COM_Invoke(pweb, "ReadyState") = 4
            Break
         Else    Sleep 500
   COM_Release(pdoc)
   COM_Release(pweb)
   COM_Term()
   Return   pweb ? "DONE!" : False
}



History:
Version 1.00 03/26/2009
Version 2.00 05/28/2009
Version 2.01 05/29/2009
Moved to <!-- m -->http://www.daviddeley.com<!-- m --> since autohotkey.net doesn't seem to be working right now


Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009
Wow! Thank you deleyd :D

It's quite fun to watch the tab cursor and the mouse cursor move by themselves.

For me, there are a few problems: :cry:

/************************************************
  6. WAIT FOR NEW PAGE TO LOAD
     (Just as we did before)
*/
;WaitLoad("Main Page - AutoHotkey")
WaitLoad("AutoHotkey")

During step 7, things get messed up about here
;DEMONSTRATE POSITIONING TO A CONTROL USING CONTROL'S NAME
ShoMsg("Positioning to search box`nusing NAME", "2.0")
ControlSetText, Edit1, javascript:document.getElementsByName( 'search')[0].focus()
ControlSend, Edit1, {Enter}, Main Page - AutoHotkey
And it never selects the search box, instead I get the following in address bar

javascript:document.getElementsByName( 'search')[0].focus()


FYI, I am running 32 bit Vista, and IE7, and have Google search box.

Leef_me


I also learned that I can search for the text of a link and then press it
#SingleInstance force

;search for the text of a link, like "Next"
;Then {ESCAPE} the search box and {TAB} to select the control and {ENTER} to activate it.

#p::   ;win P, chosen at random  :) 

j= 100
k= 500
Send ^f
Sleep %k%
Send Next
Sleep %k%
send {ENTER}
;return
Sleep %k%
send {ESCAPE}
Sleep %j%
send {TAB}
Sleep %j%
send {ENTER}

return



deleyd
  • Members
  • 64 posts
  • Last active: Sep 27 2011 06:35 AM
  • Joined: 08 Mar 2008
Search for the text — that's a brilliant idea! I'll add that method.

The Javascript in the address bar is how that jump to a control method works. It's supposed to execute the javascript to position you on the control. I suppose if your browser has Javascript disabled that could prevent it from working.

I don't recall where I picked up the Javascript technique. Probably on this forum somewhere. I do see in the IE and Gui Browser Com Tutorial post tank calls the 'Javascript in the URL' method "clumsy":

Using Seans COM library to automate web tasks takes some learning how but removes the need to use some other clumbsy tactics like sending javascript thru address bar or using image search etc.


Maybe someday if I ever have time (which seems unlikely for the foreseeable future) I'll learn the more advanced Com method.

Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009

Search for the text — that's a brilliant idea! I'll add that method.

You are too kind.

The Javascript in the address bar is how that jump to a control method works. It's supposed to execute the javascript to position you on the control. I suppose if your browser has Javascript disabled that could prevent it from working.

I have security set at Medium-high, which should not disable javascript

BTW, found another oops:
;Move left until we find a non-white pixel
ShoMsg( "Demonstrate moving left looking for a non-white pixel color", "2.0")
loop 200
{
    MouseMove, X, Y, 0
    PixelGetColor, color, X, Y, RGB
    ;ShoMsg( "color=%color%", "0.1" )
    if (color <> "0xFFFFFF")
    {
;====================
; the following line works
      MsgBox The color at the current cursor position is %color%.
      Goto FOUND_TCOLOR
    }
    X -= 1
}
;If we drop out here, it means we failed to find a non-white colored pixel
ShoMsg( "Failed to find a non-white color`n(This is just a demo)", "2.0" )
goto Exit


FOUND_TCOLOR: 
;====================
; the following line does not work
ShoMsg( "Found a non-white color`npixel color = %color%", "2.0" ) 


deleyd
  • Members
  • 64 posts
  • Last active: Sep 27 2011 06:35 AM
  • Joined: 08 Mar 2008
I see why the jumping to a control example wasn't working. The title of the main AutoHotkey Wiki page changed from "Main Page - AutoHotkey" to "AutoHotkey".

It never found a window titled "Main Page - AutoHotkey".

I fixed this by having it search for just "AutoHotkey" in the window title.

Also updated the example to version 2.01
Added mention of your "Search for word which is link you want to click on" method. Could be quite useful in some situations.
Added some more general comments.


Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009
Can anyone suggest how to do the following:

I trying further to use AHK to control a webpage under I.E.
Using the IE search ^F or the tab key it is possible to select a link on a webpage.
If Enter is pushed (or sent by AHK) if effectively clicks the link.

What I am searching for is the way to get the mouse coords of the
link that has focus, and then save those mouse coords for future use.

Any suggestions on how to read the location of the link?

Leef_me

ipporek
  • Members
  • 4 posts
  • Last active: Apr 26 2010 02:10 PM
  • Joined: 14 Apr 2010

Can anyone suggest how to do the following:

I trying further to use AHK to control a webpage under I.E.
Using the IE search ^F or the tab key it is possible to select a link on a webpage.
If Enter is pushed (or sent by AHK) if effectively clicks the link.

What I am searching for is the way to get the mouse coords of the
link that has focus, and then save those mouse coords for future use.

Any suggestions on how to read the location of the link?

Leef_me


Oh, was thinking of that too (though not reading the location of the link, but just basically clicking on it). Cos for the site I'm visiting, it's all ASP and pressing ENTER doesn't work. So I'd have to click on the link instead.

Furious Angel
  • Members
  • 9 posts
  • Last active: Oct 11 2010 09:02 AM
  • Joined: 24 Aug 2010
Thanks so much for this.

3 days ago I had never heard of AHK but a compination of this script, a few others and some help from tank has really set me on my way.

Very, very grateful indeed!

awannaknow
  • Members
  • 372 posts
  • Last active: Feb 02 2017 01:01 AM
  • Joined: 14 Jun 2009
Thank you deleyd,
I wondered how to automate in a browser, and was never able to figure it out !
But with your script as an example I succeded in doing so in an htpps form.
It's not yet accomplished as I have to wait until a precise date, once a month, to log in and fill it in.
But I started to test it with what is actually accessible and it's ok for now.
Looking forward for the 28th this month, which I'll be authorized to log in . . .
:wink:
New link for IE7 Developper ToolBar
The one given in deleyd's code didn't work for me.

Frankie
  • Members
  • 2930 posts
  • Last active: Feb 05 2015 02:49 PM
  • Joined: 02 Nov 2008
Looks great. Wish I could test it (COM doesn't play nicely with IE9 Beta)
aboutscriptappsscripts
Request Video Tutorials Here or View Current Tutorials on YouTube
Any code ⇈ above ⇈ requires AutoHotkey_L to run

juandante
  • Members
  • 12 posts
  • Last active: Dec 12 2011 10:42 PM
  • Joined: 10 Dec 2011
Hi the best idea to me, but I don't know if it's possible is to search for a text on web page, select it then quickly press tab or shift tab.
You fall down 90% of the time on what you want to click or where you want to input text.

On any any web page there is also 90% of text because of compatibility, so you just have to search and select the good one to fall down on where you want to input something or press enter on.

For flash games image search will work perfectly.

GlxyDs
  • Members
  • 39 posts
  • Last active: Dec 06 2012 10:44 PM
  • Joined: 09 Jun 2011
Does this work for AHK_L without COM.ahk?

skeitel
  • Members
  • 10 posts
  • Last active: Mar 27 2013 03:55 PM
  • Joined: 11 Mar 2013

Is this information updated? Are there other ways to navigate a webpage now? I heard somewhere that "COM is now included in AHK_L"? Is that true or do I have to install something extra to make scripts like these above, work?

 

I am a newbie and having a really hard time trying to learn AHK to do a simple task like jumping to the text field in a form and typing some stuff up there. I am very confused, please help!



Niraj
  • Members
  • 1 posts
  • Last active: Apr 30 2013 07:31 AM
  • Joined: 29 Apr 2013

any thing wrong in this code

 

 

 
#space::run, iexplore.exe http://www.google.com/
WaitLoad("google")
//Send delhi,{Enter}
return

 

while using above code the below error was comming

 

call to nonexistent function



Jackie Sztuk _Blackholyman
  • Spam Officer
  • 3757 posts
  • Last active: Apr 03 2016 08:47 PM
  • Joined: 28 Feb 2012
Deleyed the OP of this topic has not been online in over a year

So please post you query's in the support forum...
Helping%20you%20learn%20autohotkey.jpg?d

[AHK] Version. 1.1+ [CLOUD] DropBox ; Copy [WEBSITE] Blog ; About