Jump to content
Sign in to follow this  
billshu

Setting Zoom in Chrome

Recommended Posts

billshu

I use the following function to set the Zoom Level in Chrome.  I just send a bunch of zoom downs then zoom up to the desired zoom level.  It works great, but now i am running multi instantances of Chrome at the same time.  All Chrome windows are affected by this function.  Is there an easy way to set zoom in only one instance of Chrome

Func SetZoom($LocalZoom)
;Chrome Zoom levels are: 25, 33, 50, 67, 75, 90, 100
   sleep(3000)
   WinActivate($MyWindowHandle)
    sleep(200)
    send("^-")
    sleep(200)
    send("^-")
    sleep(200)
    send("^-")
    sleep(200)
    send("^-")
    sleep(200)
    send("^-")
    sleep(200)
    send("^-")
    sleep(200)
    send("^-")
    sleep(200)
    send("^-")
    sleep(200)
    send("^-")
    sleep(200)
    send("^-")
    sleep(200)
    ; Zoom should now be 25

    If $LocalZoom > 32 Then
       Send("^{+}")    ; Zoom Level is now 33
       sleep(200)
    EndIf

    If $LocalZoom > 49 Then
       Send("^{+}") ; Zoom Level is now 50
       sleep(200)
    EndIf

    If $LocalZoom > 66 Then
        Send("^{+}") ; Zoom Level is now 67
       sleep(200)
   EndIf

   If $LocalZoom > 74 Then
       Send("^{+}") ; Zoom Level is now 75
       sleep(200)
   EndIf

   If $LocalZoom > 89 Then
       Send("^{+}") ; Zoom Level is now 90
       sleep(200)
   EndIf

   If $LocalZoom > 99 Then
       Send("^{+}") ; Zoom Level is now 100
       sleep(200)
   EndIf
   Sleep(1500)
   Return(1)


EndFunc
 

Share this post


Link to post
Share on other sites
vkrisz81

Autoit can handle chrome already???

Share this post


Link to post
Share on other sites
vkrisz81

Yes it really dont easy.. And the enduser need must to do, while to ie he has only upgrade his browser... Ty

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  

×