Jump to content

Setting Zoom in Chrome


billshu
 Share

Recommended Posts

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
 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...