MattyBed Posted September 25, 2016 Share Posted September 25, 2016 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 comment Share on other sites More sharing options...
l3ill Posted September 25, 2016 Share Posted September 25, 2016 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 My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
MattyBed Posted September 25, 2016 Author Share Posted September 25, 2016 5 minutes ago, l3ill said: in that address bar you want to check Thank you for reply. So what can i do when in suffix adress are a random values? Example: www.site.com/file/2345 then TRUE www.site.com/other then FALSE Link to comment Share on other sites More sharing options...
l3ill Posted September 25, 2016 Share Posted September 25, 2016 (edited) 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 September 25, 2016 by l3ill My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now