Jump to content

Error in FF.au3 script, please help


Recommended Posts

My code:

~~~~~~~~~~~~

#Include <FF.au3>

_FFStart("www.msn.com")

If _FFTabExists("www.Google.com") then

_FFOpenUrl("www.yahoo.com")

EndIf

~~~~~~~~~~~~

Hello, I wanted to make a script to open a page when a page is open.

For example,

If I open the .au3 script and I goto www.Google.com, I want www.yahoo.com to open automatically, because I opened www.google.com.

As you could see with the above code, Im saying if google.com tab exists to open yahoo.com in another tab automatically.

It doesnt work,

Any solutions? BTw im a noob

Thanks

Link to comment
Share on other sites

To leave the Noob state you need to learn and practice.

First step when you need to hunt a bug is to check for errors after every function call. Depending on the function you have to verify

  • the return value
  • the value of macro @error and @extended
So what does _FFTabExists tell you?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

@water _FFTabExists (i think) to verify that a tab exists, then to set an action for it. In this case I want it to automatically go to another site once the "tab" "exists"... Yes I know I am not to good with autoit and its only been my third day working in it as I am primarily a web coder.

But I just wanted to make an ff.au3 code to help me track all of my sites that Im developing.

Do you still have any solutions

Link to comment
Share on other sites

Nope.

It doesnt work

Our question is, what is 'it'? Does Firefox open? Does it go to msn.com? Any AutoIt error popups? Etc, etc. Like water says, what is the return value and error code?

#Include <FF.au3>
_FFStart("www.google.com")
Global $ReturnValue = _FFTabExists("www.Google.com")
MsgBox(0, '', 'Return value: ' & $ReturnValue & @CRLF & 'error; ' & @error & 'extended: ' & @extended)

That'll give you a general idea on how to debug your code and find out where things go wrong. I don't have Firefox installed so I haven't tested and I'm rather curious at the results. Because for one, you're checking for www.Google.com, you see...

I can guess at other pitfalls (missing While loop for one) and also churn out a script that does what you want, but you won't be learning much from that. Since you state you're a web coder I'm guessing you know your way around javascript. So I guess you'll also be able to figure out why you need a While loop.

The general philosophy on this forum is teaching noobs how to code rather than handing out copypasta. Don't take it the wrong way, we're more than willing to help provided you're willing to learn. Creating four near similar topics isn't really helping though... Also,help files.

[center]Spiderskank Spiderskank[/center]GetOpt Parse command line options UDF | AU3Text Program internationalization UDF | Identicon visual hash UDF

Link to comment
Share on other sites

Firefox supports multiple homepages right out of the box simply use the pipe "|" character to seperate webpages. And of course you do this in the Options > General in Firefox.

http://www.google.com | http://www.yahoo.com | http://www.youtube.com | etc.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...