Jump to content

Recommended Posts

Posted

Hi guys im new here and im not sure if it is the right section so please move me if im wrong :D

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? 

Posted (edited)

@Celtic88 your way will run only the first link

try 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 by Chimp

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Posted

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

 

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
  • Recently Browsing   0 members

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