Jump to content

Recommended Posts

Hello guys, my english is bad so im sorry. I have here a sample code:

WinActivate  ("Mozilla Firefox")
Send("^l");; selects the address bar contents
Send("^c");; copies it to the clipboard
$sDomain = ClipGet()
If $sDomain="https://www.autoitscript.com/" "+suffix adress" Then
MsgBox(0, "Result", "True")
Else
    MsgBox(0, "Result", "False")
EndIf

What should I enter in "+suffix adress", if i want to see if the active window has the link?

Link to post
Share on other sites

Hi and welcome,

Well, whatever comes after the:

"https://www.autoitscript.com/"

in that address bar you want to check

you have to write it like this though or it wont work:

If $sDomain="https://www.autoitscript.com/" & "forum/" Then

for instance...

or for this post we are in now would be:

"topic/184739-help-with-url/#comment-1326887"

Bill

Link to post
Share on other sites

That sounds like a job for StringInString or regex (Regular Expression)

If  Not StringInStr($sDomain, "www.site.com/") =  0 Then
MsgBox(0, "Result", "True")
Else
    MsgBox(0, "Result", "False")
EndIf

for example...

Edited by l3ill
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...