Jump to content
Sign in to follow this  

How to get the next consecutive number?

Recommended Posts


Hi all

I would like to be able to automate the process of naming a saved file.

The file would need to be a uniquely named file, eg say 500 times, something like "Page 1" "Page 2" etc.

Is there a way i can get it to add "1" to the text after i enter the text "Page" each loop it does?

Thanks in advance

Share this post

Link to post
Share on other sites
MSLx Fanboy

Here's just a small example of writing to a file. In this example, moving $Content into the for loop and changing its value can make dynamic text in each file.

$Content = "This is the first line" & @CRLF & "This is the second line" & @CRLF

$stop = 500;will make 500 loops
For $x = 1 To $stop
   $fName = "Page" & $x & ".txt"
   FileWrite($fName, $Content)

Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

Share this post

Link to post
Share on other sites

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

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.