I made a little script that makes a registration code such as “DIY0-068W-W4CR-R5AA”.
set randomString to randomString_(4)
on randomString_(anumb)
set randomChars to {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}
set aString to ""
set thestring to ""
repeat (anumb * 4) times
set aString to aString & some item of randomChars
end repeat
set numb to 0
repeat anumb times
set numb to numb + 1
if numb is not anumb then
set thestring to thestring & text beginning thru 4 of aString & "-"
else
set thestring to thestring & text beginning thru 4 of aString
end if
set aString to text 4 thru end of aString
end repeat
return thestring
end randomString_