Scinner Posted March 12, 2010 Share Posted March 12, 2010 Hi there all! I'm trying to get this script to work but I'm short of knowledge, it seems. If FF is connected to a certain paige I wan't something to happend and if it's connected to a not specified paige I wan't something else to happend. Could someone, please, help me out. #include <FF.au3> _FFConnect() If _FFIsConnected() Then $sTitle = _FFCmd(".title") If $sTitle = "Google" Then MsgBox(64, "", "This is a search engine.") ElseIf $sTitle = "AutoIt Forums" Then MsgBox(64, "", "This is where all the magic happends.") ElseIf $sTitle = "Some other .title than the above" Then MsgBox(64, "", "You are way off.") EndIf Link to comment Share on other sites More sharing options...
MHz Posted March 12, 2010 Share Posted March 12, 2010 Looks like your nested If block of code is not correct so I modified it. Put your else code where I show the comment.#include <FF.au3> _FFConnect() If _FFIsConnected() Then $sTitle = _FFCmd(".title") If $sTitle = "Google" Then MsgBox(64, "", "This is a search engine.") ElseIf $sTitle = "AutoIt Forums" Then MsgBox(64, "", "This is where all the magic happends.") ElseIf $sTitle = "Some other .title than the above" Then MsgBox(64, "", "You are way off.") Else ; Add code here to do something else EndIf EndIf Link to comment Share on other sites More sharing options...
Scinner Posted March 12, 2010 Author Share Posted March 12, 2010 Looks like your nested If block of code is not correct so I modified it. Put your else code where I show the comment.Me and If statements are not friends. I dont like them and they don't like me. Thanks a bunch! 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