Julenissen

WinMove - Internet Explorer Issue

5 posts in this topic

Hi everyone :)

Since this is my first post on this forum, feel free to send me any notes regarding wrong topic, using forbidden words etc.

This is my first day with AutoIT, so don't be surprised if the soultion of my problem might be pretty simple ;p So far I have tried my best with C++ so I am not a total newbie at scripting (I guess...)

 I am currently working on a simple script that opens web browser and then specific website (with weather forcasts). I would like to use WinMove function in order to click the right spots on the website via MouseClick function and thus generating a right forecast. 

I have tried the script on Google Chrome and it works like charm, but when I tried to move web browser window via WinMove script didn't react at all, only the part with running IE and mouse clicking worked. Does anyone might have a clue what could be the reason for that? Below you can find the script

PS. Don't worry to run it. It's Polish website run by on of the universities  so no viruses included ;p You can change the display language to English.

Run ("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe ""http://www.meteo.pl/""")
WinWaitActive("METEO.PL - Google Chrome","",10)
WinMove ( "METEO.PL - Google Chrome", "", 0, 0, 960, 1040 )
MouseClick("", 164, 492, 1)
Sleep(1000)
MouseClickDrag("", 944, 425, 944, 599)
Sleep(1000)
MouseClick("", 785, 589, 1)
Sleep(1000)
WinMove ( "Meteorogramy - meteorograms - Google Chrome", "", 960, 0, 960, 1040 )

Sleep(10000)



Run ("C:\Program Files\Internet Explorer\iexplore.exe ""http://www.meteo.pl/""")
WinWaitActive("METEO.PL - Windows Internet Explorer","",10)
WinMove ( "METEO.PL - Windows Internet Explorer", "", 960, 0, 960, 1040 )
MouseClick("", 0, 0, 1)
Sleep(1000)
MouseClickDrag("", 944, 425, 944, 599)
Sleep(1000)
MouseClick("", 0, 0, 1)
Sleep(1000)
WinMove ( "Meteorogramy - meteorograms - Windows Internet Explorer", "", 960, 0, 960, 1040 )

I would be very grateful for any advice.

Cheers ;)

Paul

 

Share this post


Link to post
Share on other sites



As I mentioned script works fine for Google Chrome, but I only mentioned it in the title that the browser which causes problems is Internet Explorer. I can't edit the post so I write it here ;)

Share this post


Link to post
Share on other sites

There is a better way to approach this. Most weather services use airport codes or zip codes for locations. I don't have time at the moment but I remember seeing something like that in this forum somewhere when someone made a weather app. Use the search function and I bet you can find it.

cheers!

-Bert

1 person likes this

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