Posts: 6
Threads: 2
Joined: Jul 2014
Hello All
Just like in the topic, what is the fastest way to find text expression on web page and get X Y coordinates of its location? First appearance is enough, ignore further finds.
Thanks!
John
Posts: 767
Threads: 262
Joined: Jul 2012
Don't know if this is the best method.
Open firefox on this page, the code below interacts with your name (blue link:
johnguo).
Macro
Macro60
;Below example only works for firefox.
int w=win("Mozilla Firefox" "Mozilla*WindowClass" "" 0x804)
FFNode f.FindFF(w "A" "johnguo" "" 0x1001)
Acc a.FromFFNode(f)
int x y
a.Location(x y)
out F"x:{x} , y:{y}"
;Activate the below code to test it out (do not activate all at the same time, test one by one).
;; To click on link, method 1
;a.DoDefaultAction
;; To click on link, method 2
;a.Mouse(1)
;; To move mouse to link
;a.Mouse(0)
;; Output href (url-link)
;out f.Attribute("href")
;(Firefox!) To get the above code:
;1. Go to: \System\Functions\Control\FFNode\FFNode help
;;;;Or put the cursor within the double quotes of the following and then press [F2]: "FFNode help"
;2. Used the example in "FFNode help"
;3. Then defined accisble objects 'Acc a' then used memberfunction 'FromFFNode'
;;;;This means type 'Acc a' immediatley followed by a dot and then list of memberfunctions will show.
;(Firefox!) Alternative:
;1. In the top right on the floating toolbar click 'Windows, controls'
;2. Select "Accessible object actions"
;3. In the dialog that pops up above top left, drag the 'Drag' icon over an object, for example a link
;4. In the left select 'Get location' and then on the right side select 'X' and 'Y'
;5. Then press 'Ok', code will be pasted
Posts: 6
Threads: 2
Joined: Jul 2014
Hi, thanks for answering
get object not found at this point : FFNode f.FindFF(w "A" "johnguo" "" 0x1001)
Posts: 767
Threads: 262
Joined: Jul 2012
1)
Are you running the installed version (not portable) of firefox?
If you are running the portable version:
http://www.quickmacros.com/forum/showthr...p?tid=4764
2)
Is firefox fully updated?
3)
If you are running the 64bit version of firefox:
-
http://www.quickmacros.com/forum/showthr...p?tid=5868
- OR in the above mentioned link:
http://www.quickmacros.com/forum/showthr...p?tid=4764
read in the 2nd post below under 'Also...'
4)
Does it help if you change the first line to:
int w=win("Mozilla" "Mozilla*" "" 2)
Posts: 6
Threads: 2
Joined: Jul 2014
Finnally got it to work, the issue was 64bit firefox version.
In case someone will need this fix in future:
1. I downloaded 34bit firefox full installer from here
http://archive.mozilla.org/pub/firefox/r...n32/en-US/
2. Added registry entry:
A. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Firefox
B. Create a new key named32to64DidMigrateand give DWORD 32-bit value name as ‘Never’ and Value data as ‘1’.
(explained in details here:
https://techdows.com/2017/10/go-back-to-...4-bit.html)
3. Run installer and change folder to program files instead of (x86)
Thanks for help r0n !