Diana (Cda) Posted 14 hours ago Posted 14 hours ago (edited) We reach tipping point sometimes. I use the "Open a specific page or set of pages" in my browser to open a set of pages on browser startup. But it's a serious pain to edit, however, and to keep maintained. And I'm finally just fed up with it despite the feature's value. I'd like to pare down the use of this function to strictly necessary pages, and get the bulk of extra URLs off into an AU3 file and text file full of links, instead. I've searched and searched for a utility and then a script, and I found this script (original URL at the very top of it): ; Th.Aug.14.2025 - https://www.reddit.com/r/autoit/comments/1iz3odb/possible_to_open_multiple_links/ #include <MsgBoxConstants.au3> Example() Func Example() ; Define the path to the text file containing the links Local $sFilePath = @ScriptDir & "\URL_links.txt" ; Read the current script file into an array using the filepath. Local $aArray = FileReadToArray($sFilePath) Local $iLineCount = @extended If @error Then MsgBox($MB_SYSTEMMODAL, "", "There was an error reading the file. @error: " & @error) ; An error occurred reading the current script file. Else For $i = 0 To $iLineCount - 1 ; Loop through the array. UBound($aArray) can also be used. ;MsgBox($MB_SYSTEMMODAL, "", $aArray[$i]) ; Display the contents of the array. ShellExecute($aArray[$i]) ;Execute each line from the file Sleep(500) ; Adjust the delay as needed Next EndIf EndFunc ;==>Example And my text file, called "URL_links.txt" I laid out with these example URLs, as per the original message in the URL listed above: https://www.youtube.com/watch?v=GygBY01Qbnk https://www.youtube.com/watch?v=LrAtBtQnvCE&list=RDLrAtBtQnvCE https://www.youtube.com/watch?v=fe5Jk7YT_JE&list=RDfe5Jk7YT_JE https://www.youtube.com/watch?v=44tiZ7IP7zA But nothing happened and no error message appeared. Was wondering if someone know what was wrong. There may be other methods of doing this, but calling on a list within a text file seems the easiest to maintain. Thank you! Edited 14 hours ago by Diana (Cda)
argumentum Posted 13 hours ago Posted 13 hours ago ShellExecute() returns the PID of the running process, if that helps. Did run the code you posted and was all good ( other than a sudden craving for peanut butter due to one of the videos ). Nothing wrong with the code. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
Nine Posted 12 hours ago Posted 12 hours ago All decent web sites have a policy of excessive usage. Maybe you fell under it. You should consider using WebDriver instead, which is lot more permissive. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
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