Sign in to follow this  
Followers 0
r0guenj

click a specific button script help

4 posts in this topic

i am new to scripting and autoit and have a question regarding a simple facebook script i put together.

for example, the following button labeled Delete when viewing the element:

<a class="_56bs _3cqr _56bt" data-store="{&quot;optimistic_uri&quot;:&quot;\/a\/mobile\/friends\/reject?subjectid=100000344478532&amp;fref=m_find_friends&amp;gfid=AQBQH1d5Z99zck5f&quot;,&quot;optimistic_post_data&quot;:null}" href="#" role="button" data-ajaxify-href="" data-sigil="touchable ignore-request ajaxify"><span class="_55sr">Delete</span></a>

instead of recording my mouse pointer locations, i want to specify the buttons directly. this is what i came up with so far. it works, but misses buttons occasionally and i think specifying the buttons directly would work better.

#comments-start

 AutoIt Version: 3.x.x.x
 Author:         r0guenj

 Function:
    This Script will click the refresh page and select the visible delete buttons until stopped.

 The exit hotkey for this script is CTRL+ALT+x

#comments-end

;Assigns the HotKey to our custom exit function
HotKeySet("^!x", "MyExit")

; The coordinates to click in pixels


$i = 0
While $i <= 10
MouseClick("left",317,148,1)
Sleep(500)
MouseClick("left",1022,268,1)
Sleep(500)
MouseClick("left",1030,354,1)
Sleep(500)
MouseClick("left",1021,437,1)
Sleep(500)
MouseClick("left",1031,518,1)
Sleep(500)
MouseClick("left",1033,609,1)
Sleep(500)
MouseClick("left",1034,700,1)
Sleep(500)

  ; Uncomment the below line to make the script click only 10 times, or until the hotkey is pressed.
    $i = $i + 1

WEnd

Func MyExit()
  Exit
EndFunc

is there a way to do this?

Share this post


Link to post
Share on other sites



Look at the IE* functions in the help file.

Run some of the examples.

Write some code.

If that code fails, post it and tell us what is going on.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

thanks ill peruse the help files again.

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