Sign in to follow this  
Followers 0
uppercode

How to receive object co-ordinates in Mozilla?

5 posts in this topic

Hello!

Whether it is possible to receive co-ordinates of the object necessary to me which now costs in focus (that is, by pressing Enter or will occur transition to page if it is the reference....... Or the button if it is the button will be pressed...... Or the picture in a new window if focus costs on a picture) in Mozilla will open? Co-ordinate most likely will be left top. For Mozilla has found very few functions UDF. To a plenty a nose a forum which day also I do not see the answer all...

Thanks for the help!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

May be can correct my code?

#Include <FF.au3>
#Include <Array.au3>
#Include <File.au3>
#include <FFEx.au3>
#Include <GuiListView.au3>

_FFStart()

If _FFConnect(Default, Default, 5000) Then
;it's address my site only for sample

_FFOpenURL("http://avtonews.h1.ru/index2.html")

$sStringToSearch = "Autonews"
;search strinng as example

_FFSearch($sStringToSearch)
;have focus on Autonews-string

Sleep(1000)
Send("{TAB 5}")

;after {TAB 5} I have new focus on LINK3!
;but mouse not have coordinate new object in the focus!!!
;and I need get it for MouseMove on LINK3

???????????
???????????

;MouseMove( LINK3_X_coordinate , LINK3_Y_coordinate )

???????????
???????????

Else
MsgBox(64, "", "Can't connect to FireFox!")
EndIf

Please, help me : how I can get coordinate new focus?

Thanks

Edited by uppercode

Share this post


Link to post
Share on other sites

If you just want to click on the link, try something like

_FFLinkClick("Touran", "text")

Otherwise maybe look at _FFGetPosition() ...

Share this post


Link to post
Share on other sites

Forgive that long did not answer.

_FFLinkClick Not that that is necessary to me.

but may be _FFGetPosition()...

how I can use it? There is use example? How correctly to specify arguments?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Forgive that long did not answer.

_FFLinkClick Not that that is necessary to me.

but may be _FFGetPosition()...

how I can use it? There is use example? How correctly to specify arguments?

Something like this should work, the example below prints the coordinates of the first link. I believe you need the whole "window.content.wrappedJSObject" for Firefox >= 3.6 for it to work. Check the _FFGetPosition documentation for the array values.

#include <FF.au3>
#include <Array.au3>
_FFConnect()
If _FFIsConnected() Then
    _FFOpenURL("http://www.google.com")
    Local $posArr = _FFGetPosition("window.content.wrappedJSObject.top.document.getElementsByTagName('a')[0]")
    ConsoleWrite(_ArrayToString($posArr, " ") & @CRLF)
    _FFDisconnect()
Else
    MsgBox(64, "Error", "Can't connect to FireFox!")
EndIf
Edited by stefantje

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0