Jump to content
Sign in to follow this  
3min3m

IF Image then click on it

Recommended Posts

3min3m

Hello Guys

I love AutoIT, but i was only a user until now.

Since i need a script, i'm trying to create it with AutoIT, but i didn't had success yet.

What i want to do:
In Firefox:

If Image is on homepage, click on it

If Image is not on homepage, press F5

I'm aware of Imagesearch but i don't get how to make this if else operation above.

I would also pay for help :)

Thanks in advance

3.

Edited by 3min3m

Share this post


Link to post
Share on other sites
3min3m

Ok what i found out till now:
 

#Include <FF.au3>
_FFSTART("thehomepageiwanttoclickonimage")
_FFImageClick("theimageiwanttoclick.jpg")

now i have to include a function which makes F5 when the image is not on the page.

Share this post


Link to post
Share on other sites
3min3m

Thanks a lot for your help, i really appreciate it!

When i try this i get:
error5jq7i.png

my code:

#Include <FF.au3>
_FFSTART("homepagee....")
_FFImageClick("pic on homepage...")
If :@error Then
    Send("{F5}")
EndIf

Edited by 3min3m

Share this post


Link to post
Share on other sites
3min3m

Ok now it works, but it only refreshs the page 1 time.

What i want to do it now:
refresh the page until the pic is on the page

ot: i have fun like a kid, this is the first script and it looks like i'll get it to work with you :))

Edited by 3min3m

Share this post


Link to post
Share on other sites
3min3m

ok i tried this now:
 

#Include <FF.au3>
_FFSTART("homepagee....")
_FFImageClick("pic on homepage...")
If @error Then
    Send("{F5}")
EndIf

Do
     Send("{F5}")
Until _FFImageClick("thepicutre.jpg")

he now makes very fast f5 (have to add the sleep function i see) but wont click image

Share this post


Link to post
Share on other sites
3min3m

I wont get it to click the image... for _FFImageClick("src of image ex: blabla.jpg")

:(

Edited by 3min3m

Share this post


Link to post
Share on other sites
3min3m

it wont work with the full http:// url and also wont work with src=url

Share this post


Link to post
Share on other sites
3min3m

should i try the imagesearch function instead of FF_Imageclick?

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  

×