#SingleInstance,Force
Random:=[],Dup:=[],Items:=[]
for a,b in StrSplit("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") ;put whatever characters you want in here
Random.Push(b) ;Add each character to Random Array
InputBox,Count,How Many Codes,How Many Codes do you want?
InputBox,Length,How Long For Each Code,How Long?
While(Items.MaxIndex()<Count){ ;Keep iterating until you have enough "keys"
Out:="" ;Clear out variable
while(StrLen(Out)<Length){
Random,Digit,0,% Random.MaxIndex() ;keep max lenght of random at right level
Out.=Random[Digit] ;append the Random digit to out.
}
if(!Dup[Out])
Items.Push(Out),Dup[Out]:=1 ;Add key to object
}
for a,b in Items ;Iterate over list
Total.=b "`n" ;Add to total with new line
msgbox % Clipboard:=Total
In market research I would very frequently have to crank out a ton of different versions of reports for a given study. In the corporate world, like it or not, PowerPoint is still king. :( By building a generic template I was able to drastically speed-up my report generation.
Setting up the template takes a little time at first however, in the long run, it will save you an amazing amount of time!
There is a lot more I automated however having a flexible template is always a great place to start!