PureAwsomeness Posted August 14, 2012 Share Posted August 14, 2012 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 ? Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 14, 2012 Moderators Share Posted August 14, 2012 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 More sharing options...
PureAwsomeness Posted August 14, 2012 Author Share Posted August 14, 2012 (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 August 14, 2012 by PureAwsomeness Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 14, 2012 Moderators Share Posted August 14, 2012 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 More sharing options...
PureAwsomeness Posted August 14, 2012 Author Share Posted August 14, 2012 (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) Nexneah it doesnt do anything Edited August 14, 2012 by PureAwsomeness Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 14, 2012 Moderators Share Posted August 14, 2012 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 More sharing options...
PureAwsomeness Posted August 14, 2012 Author Share Posted August 14, 2012 Im very noob i can't do it it's beyond me WinWaitActive("[Class:MozillaWindowClass]") _IENavigate($oIE, "http://www.autoitscript.com/forum/index.php?") :????? Link to comment Share on other sites More sharing options...
PureAwsomeness Posted August 14, 2012 Author Share Posted August 14, 2012 (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 August 14, 2012 by PureAwsomeness Link to comment Share on other sites More sharing options...
Mechaflash Posted August 14, 2012 Share Posted August 14, 2012 $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)Nextsomething 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 More sharing options...
PureAwsomeness Posted August 14, 2012 Author Share Posted August 14, 2012 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...:| Link to comment Share on other sites More sharing options...
trancexx Posted August 14, 2012 Share Posted August 14, 2012 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 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 14, 2012 Moderators Share Posted August 14, 2012 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 More sharing options...
trancexx Posted August 14, 2012 Share Posted August 14, 2012 Almost everyone here will help you, don't worry about that.Still this is not general write me a script forum. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
PureAwsomeness Posted August 14, 2012 Author Share Posted August 14, 2012 (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 August 14, 2012 by PureAwsomeness Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 14, 2012 Moderators Share Posted August 14, 2012 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 More sharing options...
PureAwsomeness Posted August 14, 2012 Author Share Posted August 14, 2012 I used it , it gaved me that error... it's there second box.. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 14, 2012 Moderators Share Posted August 14, 2012 (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 August 14, 2012 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 More sharing options...
PureAwsomeness Posted August 14, 2012 Author Share Posted August 14, 2012 (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 August 14, 2012 by PureAwsomeness Link to comment Share on other sites More sharing options...
Mechaflash Posted August 14, 2012 Share Posted August 14, 2012 (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 August 15, 2012 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 More sharing options...
PureAwsomeness Posted August 15, 2012 Author Share Posted August 15, 2012 I tried your code : #include <FF.au3> $var = _FFStart("www.autoitscript.com") For $i = 1 to 3 $url = FileReadLine(@DesktopDir & "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 & $url = FileReadLine(@DesktopDir &^ 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 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