AleOtero93
AleOtero93

Reputation: 498

Maximize window if exists, open if it does not

My problem is pretty simple, but after investing some time reading the AutoHotkey help and couldn't find an answer, I decided to post it here.

I want a script that open a web page if it isn't openned yet. And if the web page is open, maximize the browser into that page.

Here is my code:

!^j::
    IfWinExist, https://webpage/index.php
        WinActivate
    IfWinNotExist, https://webpage/index.php
        Run, https://webpage/index.php
Return

Any help is appreciated.

Upvotes: 0

Views: 418

Answers (1)

AleOtero93
AleOtero93

Reputation: 498

Ok I solved it. I was having some trouble with functions and asking for the web path, instead of the web title. So here its the new code.

!^j::
    If WinExist("The Title")
        WinActivate
    else
        Run, https://webpage/index.php
Return

Upvotes: 1

Related Questions