lordsocke Posted September 1, 2015 Share Posted September 1, 2015 Hi guys im new here and im not sure if it is the right section so please move me if im wrong So I want to create a programm where you are able to open links from a .txt flie one by one automaticly can anybody tell me how to do this best? Link to comment Share on other sites More sharing options...
Celtic88 Posted September 1, 2015 Share Posted September 1, 2015 (edited) copy the code from herehttps://www.autoitscript.com/autoit3/docs/functions/FileReadToArray.htm and just replace this line " MsgBox($MB_SYSTEMMODAL, "", $aArray[$i]) ; Display the contents of the array. " with "ShellExecute ( $aArray[$i]) ; command to open links " Edited September 1, 2015 by Celtic88 lordsocke 1 Link to comment Share on other sites More sharing options...
Gianni Posted September 1, 2015 Share Posted September 1, 2015 (edited) @Celtic88 your way will run only the first linktry this variant:#include <File.au3> Local $aRecords If Not _FileReadToArray("Links.txt", $aRecords) Then MsgBox(4096, "Error", " Error reading file to Array error:" & @error) Exit EndIf For $x = 1 To $aRecords[0] ShellExecute("iexplore.exe", $aRecords[$x]) Next Edited September 1, 2015 by Chimp lordsocke 1 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
lordsocke Posted September 1, 2015 Author Share Posted September 1, 2015 @Chimp yours worked very fine but how can I open them one by one until they are loaded? Link to comment Share on other sites More sharing options...
Gianni Posted September 1, 2015 Share Posted September 1, 2015 (edited) then have a look to the examples of the _IECreate() function https://www.autoitscript.com/autoit3/docs/libfunctions/_IECreate.htmand pay attention to the $iWait parameter... Edited September 1, 2015 by Chimp Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
TheDcoder Posted September 1, 2015 Share Posted September 1, 2015 @lordsocke You need:For NextFileReadToArrayShellExecuteThat's all you need, TD EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted September 1, 2015 Share Posted September 1, 2015 This is my crack at it. Assuming I get what you want to be opening a list of sites from a txt file but not opening them all at once instead opening the next after the first is closed.To make this browser independent I did not use any of the IE functions and use a hotkey + variable combo to trigger the "open next" Everything will open with your default browser.;Set Alt+n to open next site and close current HotKeySet("!n", "WaitNext") ;Read files from SiteList.txt to an array $aFileList = FileReadToArray("SiteList.txt") #cs sitelist.txt example Https://Google.com Http://Cisco.com https://www.autoitscript.com/forum #CE For $i = 0 to UBound($aFileList) -1 $vNext = 1 ShellExecuteWait($aFileList[$i], "", "", "", @SW_MAXIMIZE) While $vNext = 1 Sleep(10) WEnd Next Func WaitNext() $vNext = 2 WinClose("") EndFunc 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