wesley57 Posted December 22, 2005 Share Posted December 22, 2005 Hi, I have a script that runs internet explorer and uses the same URL with a slightly different address. For example: Func PageSwitcher $x = 0 If $x = 0 Then Run ("C:\Program Files\Internet Explorer\iexplore http://www.webpage.com/number1", "") $x = $x + 1 Exitloop Endif If $x = 1 Then Run ("C:\Program Files\Internet Explorer\iexplore http://www.webpage.com/number2", "") $x = $x + 1 Exitloop EndIf If $x = 2 Then Run ("C:\Program Files\Internet Explorer\iexplore http://www.webpage.com/number3", "") $x = $x - 2 ; now $x equals 0 and repeats the loop Exitloop EndIf EndFunc Now, is there a more efficient way to do this? The way I have come up with works, but I have to have practically the same thing copied about 40 times with only a slight change in the link. I was thinking perhaps there was a way to take the "numberX" part out and replace it with a variable that had all of the number 1s, 2s, etc defined in it, and it would just grab them in order when called up. Any help- especially an example script- would be much appreciated, thanks Link to comment Share on other sites More sharing options...
erebus Posted December 22, 2005 Share Posted December 22, 2005 (edited) Func PageSwitcher() Dim $x For $i = 1 To 10 Run (@ProgramFilesDir & "\Internet Explorer\iexplore.exe http://www.webpage.com/number" & $i, @ProgramFilesDir & "\Internet Explorer") $x = $x + 1 Next ;Sleep(500); I comment this out but you may need it EndFunc Edited December 22, 2005 by erebus Link to comment Share on other sites More sharing options...
CyberSlug Posted December 22, 2005 Share Posted December 22, 2005 erebus has the answer, but if you ever want something LESS automated, you should look at the increment bookmarkletDetails at http://www.squarefree.com/bookmarklets/misc.htmlYou can put the bookmarklet in your favorites or links toolbar Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! 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