Jump to content

Im in need of help


Recommended Posts

  • Moderators

Hi, PureAwsomeness. A couple of ways to go: if the text file is short, you could use FileReadLine, like this:

#include <IE.au3>

$var = _IECreate("www.autoitscript.com", 0, 1, 1, 1)

For $i = 1 to 3
  $url = FileReadLine(@DesktopDir & "site.txt", $i)
  _IENavigate($var, $url, 1)
  Sleep(2000)
Next

If your text file has more than a few lines, however, I would look into FileReadToArray.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

If you want it for FireFox, you need to look at the FF UDF in the Examples Forum. The suggestion I gave is specifically for IE.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

But if i open myself the firefox and let the progrm WinWaitActive("[Class:MozillaWindowClass]")

$var = WinWaitActive("[Class:MozillaWindowClass]")("www.autoitscripts.com", 0, 1, 1, 1)

For $i = 1 to 3 $url = FileReadLine(@DesktopDir & "site.txt", $i) _IENavigate($var, $url, 1) Sleep(2000) Nex

neah it doesnt do anything

Edited by PureAwsomeness
Link to comment
Share on other sites

  • Moderators

You can't use _IENavigate on a Firefox window. If you want to do this in firefox, you have to use the firefox UDF.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

$url = "www.autoitscript.com"

Run(@ProgramFilesDir & "Mozilla Firefoxfirefox " & $url, "", @SW_MAXIMIZE)

this works

$var = Run(@ProgramFilesDir & "Mozilla Firefoxfirefox " & $url, "", @SW_MAXIMIZE)

For $i = 1 to 3

$url = FileReadLine(@DesktopDir & "site.txt", $i)

_IENavigate($var, $url, 1)

Sleep(2000)

Next

something with the ... _IENavigate($var, $url, 1)

i can't figure it out...

Edited by PureAwsomeness
Link to comment
Share on other sites

$url = "www.autoitscript.com"

Run(@ProgramFilesDir & "Mozilla Firefoxfirefox " & $url, "", @SW_MAXIMIZE)

this works

$var = Run(@ProgramFilesDir & "Mozilla Firefoxfirefox " & $url, "", @SW_MAXIMIZE)

For $i = 1 to 3

$url = FileReadLine(@DesktopDir & "site.txt", $i)

_IENavigate($var, $url, 1)

Sleep(2000)

Next

something with the ... _IENavigate($var, $url, 1)

i can't figure it out...

*SLAP* aye... he said look at the firefox UDF... so go look at the firefox UDF.

Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Link to comment
Share on other sites

  • Moderators

PureAwsomeness, let's see if we can explain a little more plainly. Functionality for controlling IE is built into AutoIt. But you want to control FireFox, which works completely differently. Hence, you need to look at the FireFox UDF to learn how to do that.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

I copied the ff.au3 in autoit source i change the source.

#include <ff.au3>
$var = _FFStart("www.autoitscript.com", 0, 1, 1, 1)
For $i = 1 to 3
$url = FileReadLine(@DesktopDir & "site.txt", $i)
_IENavigate($var, $url, 1)
Sleep(2000)
Next

but by looking at that long list i can't find the equivalent of the - _IENavigate($var, $url, 1) - "IENavigate"

then i tried

#include <ff.au3>

$var = _FFStart("www.autoitscript.com", 0, 1, 1, 1)

For $i = 1 to 3
  $url = FileReadLine(@DesktopDir & "site.txt", $i)
  _FFOpenURL($var, $url, 1)
  Sleep(2000)
Next

Gaved me this

>"C:Program FilesAutoIt3SciTE..autoit3.exe" /ErrorStdOut "D:autoit scripsInsertURLBROWSERFROMLIST.au3"
_FFStart ==> Invalid data type: (IP) $IP: 1
D:autoit scripsInsertURLBROWSERFROMLIST.au3 (7) : ==> Incorrect number of parameters in function call.:
_FFOpenURL($var, $url, 1)
^ ERROR
>Exit code: 1 Time: 0.438
Edited by PureAwsomeness
Link to comment
Share on other sites

  • Moderators

but by looking at that long list i can't find the equivalent of the - _IENavigate($var, $url, 1) - "IENavigate"

Really?! _FFOpenURL is pretty darn close to the top.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

The error output is telling you what you need to know -

D:autoit scripsInsertURLBROWSERFROMLIST.au3 (7) : ==> Incorrect number of parameters in function call.:

_FFOpenURL($var, $url, 1) <---the function accepts two, you have three.

As Trancexx suggested already, why not take the time to read, and learn why things to what they do? Read through the _FFOpenURL function, see how many arguments it takes, rather than reposting at the first sign of a hiccup?

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

#include <ff.au3>
$var = _FFStart("www.autoitscript.com")
For $i = 1 to 3
$url = FileReadLine(@DesktopDir & "site.txt", $i)
_FFOpenURL($var, $url)
Sleep(2000)
Next

changed it again :| still eror im giving up :|

>"C:Program FilesAutoIt3SciTE..autoit3.exe" /ErrorStdOut "D:autoit scripsInsertURLBROWSERFROMLIST.au3"
__FFStartProcess: ""C:Program FilesMozilla Firefoxfirefox.exe" -new-window "http://www.autoitscript.com" -repl 4242
_FFConnect: OS: WIN_7 WIN32_NT 7600
_FFConnect: AutoIt: 3.3.8.1
_FFConnect: FF.au3: 0.6.0.1b-3
_FFConnect: IP: 127.0.0.1
_FFConnect: Port: 4242
_FFConnect: Delay: 2ms
_FFConnect: Socket: 508
_FFConnect: Browser: Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20100101 Firefox/14.0.1
__FFSendJavaScripts: Sending functions to FireFox .......... done
_FFLoadWait: ..... loaded in 1307ms
_FFOpenURL ==> Invalid data type: (URL) $sURL: http://1
_FFOpenURL ==> Invalid data type: (URL) $sURL: http://1
_FFOpenURL ==> Invalid data type: (URL) $sURL: http://1
>Exit code: 0 Time: 15.625

it only fires up the www.autoitscripts.com the rest gives me errors..

Edited by PureAwsomeness
Link to comment
Share on other sites

_FFOpenURL ==> Invalid data type: (URL) $sURL: http://1
_FFOpenURL ==> Invalid data type: (URL) $sURL: http://1
_FFOpenURL ==> Invalid data type: (URL) $sURL: http://1

it only fires up the www.autoitscripts.com the rest gives me errors..

Look at what the error is telling you what's wrong.

Looking at the syntax of _FFOpenURL, you are using bad arguments.

This should work...

#include <ff.au3>
$var = _FFStart("www.autoitscript.com")
For $i = 1 to 3
  $url = FileReadLine(@DesktopDir & "site.txt", $i)
  _FFOpenURL($url)
Sleep(2000)
Next

See here for documentation on FF.au3 functions

http://english.documentation.ff-au3.thorsten-willert.de/

Edited by mechaflash213
Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Link to comment
Share on other sites

I tried your code :

#include <FF.au3>
$var = _FFStart("www.autoitscript.com")
For $i = 1 to 3
$url = FileReadLine(@DesktopDir &amp; "site.txt", $i)
_FFOpenURL($url)
Sleep(2000)
Next

gaved me this error :

>"C:Program FilesAutoIt3SciTE..autoit3.exe" /ErrorStdOut "D:autoit scripsx3.au3"
D:autoit scripsx3.au3 (4) : ==> Missing separator character after keyword.:
$url = FileReadLine(@DesktopDir &amp
$url = FileReadLine(@DesktopDir &amp^ ERROR
>Exit code: 1    Time: 0.248

then i tried something else :

#include <FF.au3>
$var = _FFStart("www.autoitscript.com")
For $i = 1 to 3
$url =  FileReadLine(@DesktopDir & "site.txt", $i)
_FFOpenURL($url)
Sleep(2000)
Next

and it gives me the error :

>"C:Program FilesAutoIt3SciTE..autoit3.exe" /ErrorStdOut "D:autoit scripsx3.au3"
__FFStartProcess: ""C:Program FilesMozilla Firefoxfirefox.exe" -new-window "http://www.autoitscript.com"  -repl 4242
_FFConnect: OS: WIN_7 WIN32_NT 7600
_FFConnect: AutoIt: 3.3.8.1
_FFConnect: FF.au3: 0.6.0.1b-3
_FFConnect: IP: 127.0.0.1
_FFConnect: Port: 4242
_FFConnect: Delay:  2ms
_FFConnect: Socket:  512
_FFConnect: Browser: Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20100101 Firefox/14.0.1
__FFSendJavaScripts: Sending functions to FireFox .......... done
_FFLoadWait: . loaded in 15ms
_FFOpenURL ==> Invalid data type: (URL) $sURL: http://
_FFOpenURL ==> Invalid data type: (URL) $sURL: http://
_FFOpenURL ==> Invalid data type: (URL) $sURL: http://
>Exit code: 0    Time: 11.285

It loads the page 3 times with the 4242 thing

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...