Sign in to follow this  
Followers 0
PureAwsomeness

Im in need of help

28 posts in this topic

Well after searching for days i can't figured it out , i have a text file with ..for example sites that are in this order

site1

site2

etc

I want the script to fetch the file and insert it ..in the browser for example

one by one how do i do this ?

Share this post


Link to post
Share on other sites



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.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

It works for the couple of 2 but then it stopss....and how i make it for firefox like FeCreate ?

It gives and eror

$var = Class:MozzilaWindowsClassCreate("www.google.com", 0, 1, 1, 1)

How should i proceed

Edited by PureAwsomeness

Share this post


Link to post
Share on other sites

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.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

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


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Im very noob i can't do it it's beyond me

WinWaitActive("[Class:MozillaWindowClass]")

_IENavigate($oIE, "http://www.autoitscript.com/forum/index.php?")

:?????

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

$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

Share this post


Link to post
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.”

 

Share this post


Link to post
Share on other sites

Dude i just said im a newb i can't figure it out i dont know what firefox udf is, it's like ie.au3 i dont know what to do whit it how to implent it...:|

Share this post


Link to post
Share on other sites

Learn language basics before engaging yourself in stuff like this.

AutoIt is like any other programming language as far as this is concerned - to be able to use be prepared to learn it.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

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.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Almost everyone here will help you, don't worry about that.

Still this is not general write me a script forum.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

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.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

I used it , it gaved me that error... it's there second box..

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

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

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

#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

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

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

 

Share this post


Link to post
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

Share this post


Link to post
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
Sign in to follow this  
Followers 0