Link to home
Start Free TrialLog in
Avatar of LEM LEM
LEM LEM

asked on

Add Site to Internet Explorer Compatability View using AutoIt

Hi All,

I am trying to automate adding  a Site to the Compatibility View in Internet Explorer 11 wit AutoIt. This is what I have so far.
Run("C:\Program Files\Internet Explorer\iexplore.exe")
 WinMenuSelectItem("[CLASS:explore]", "&Tools", "Compatibility View Settings...")

Open in new window

This code opens Internet Explorer but doesn't open the Tools > Compatibility on the menu bar of Internet Explorer.
Is there someone that is proficient with Auto It that can assist?

Regards,
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

You should add a wait between starting the IE application and trying to select/click a menu item.

When IE has not started, the select/click will not work.

WinWaitActive is a function you can use for that.
Avatar of LEM LEM
LEM LEM

ASKER

I modified the code to:
;Script Start - Add your code below here
Run("C:\Program Files\Internet Explorer\iexplore.exe")
WinWaitActive("Untitled - iexplore")
WinMenuSelectItem("[CLASS:iexplore]", "&Tools", "Compatibility View Settings...")

Open in new window

It stills opens Internet Explore and nothing else.
I have looked for a while but I am not able to find other similar codes for Internet Explorer.

Regards,
ASKER CERTIFIED SOLUTION
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LEM LEM

ASKER

Thank you for the correction and solution. I was able to complete the code.

Run("c:\Program Files (x86)\Internet Explorer\iexplore.exe -new about:blank")
WinWaitActive("[CLASS:IEframe]", "", 5)
Send("{LALT}tb")
WinWaitActive("[CLASS:IEframe]", "", 5)
Send("site.com")
ControlClick("Compatibility View Settings", "", "Button1")
WinWaitActive("[CLASS:IEframe]", "", 5)
ControlClick("Compatibility View Settings", "", "Button5")
WinClose("Blank Page - Internet Explorer")

Open in new window



Bu the way, Send("{LALT}tb") = is to open Compatibility View, where can I get a list for the others , for example, Open Internet Options?
Avatar of LEM LEM

ASKER

Now Working
Thanks for your feedback, the {LALT} is the Left ALT key, with the t is the combination to open the Tools menu, b is the option to select in that menu.
Avatar of LEM LEM

ASKER

Thank you for the explanation.