Jump to content

Recommended Posts

Posted

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
Posted

Looks like your nested If block of code is not correct so I modified it. :mellow:

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
Posted

Looks like your nested If block of code is not correct so I modified it. :mellow:

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!

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
×
×
  • Create New...