PassWord and UserName Genorater

Password is probably the one people need Username one was just for fun
Username Genorator


set letterList to {"Man", "Boy", "Woman", "Girl", "WoW", "Fan", "Minecraft", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "FanBoy", "FanGirl", "CallofDutyFan", "AppleScripter", "Windows", "Mac", "KillerMonkey", "Gamer", "10", "11", "13", "14", "15", "16", "17", "18", "19", "20"}
randomThreeLetters(letterList)

on randomThreeLetters(letterList)
	set cleanList to {}
	repeat 3 times
		set cleanList's end to some item of letterList
	end repeat
	
	return (cleanList as text)
end randomThreeLetters

Password Genorator


set letterList to {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "1", "2", "3", "4", "5", "6", "7", "8", "9", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "0", "/", "?"}
randomSevenLetters(letterList)

on randomSevenLetters(letterList)
	set cleanList to {}
	repeat 7 times
		set cleanList's end to some item of letterList
	end repeat
	
	return (cleanList as text)
end randomSevenLetters

Hope you like :smiley:
EDIT:
I have edited the code some more and did this


set letterList to {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "1", "2", "3", "4", "5", "6", "7", "8", "9", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "0", "/", "?", "_"}
randomSevenLetters(letterList)

on randomSevenLetters(letterList)
	set cleanList to {}
	display dialog "how many letters would you like?" buttons {"4", "10", "16"}
	set the clicked_button to the button returned of the result
	repeat clicked_button times
		set cleanList's end to some item of letterList
	end repeat
	
	return (cleanList as text)
end randomSevenLetters

display dialog result buttons {"I hate that password", "Thanks for the password"}
set the clicked_button2 to the button returned of the result
if the clicked_button2 is "I hate that password" then
	display dialog "Try aguin please "
end if

I’m Wondering if it would be possible to set up a repeat if you pressed I hate that password button and is it possible to have more then 3 buttons

Hi, lijrobert. Welcome to MacScripter and thanks for posting your script ” although the main handler’s essentially the same as thewaytoapplescript’s, from which it’s derived.

One thing you could do to save having to write a different handler for each different number of included items is to pass the number as a parameter.

Also, when you coerce a list to text ” as in the last line of the handler ” it’s always a good idea to set AppleScript’s text item delimiters explicitly to “” or {“”} first, to ensure that no extra characters are interpolated into the final result.

set letterList to {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "1", "2", "3", "4", "5", "6", "7", "8", "9", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "0", "/", "?"}
randomText(letterList, 7)

on randomText(theList, theLength)
	set cleanList to {}
	repeat theLength times
		set cleanList's end to some item of theList
	end repeat
	
	set astid to AppleScript's text item delimiters
	set AppleScript's text item delimiters to ""
	set cleanText to (cleanList as text)
	set AppleScript's text item delimiters to astid
	
	return cleanText
end randomItems

Another approach, if you’re only working with single characters, is to dispense with lists altogether and just concatenate the characters:

set sourceText to "abcdefghijkl123456789!@#$%^&*()0/?"
randomText(sourceText, 7)

on randomText(sourceText, theLength)
	set cleanText to some character of sourceText
	repeat theLength - 1 times
		set cleanText to cleanText & some character of sourceText
	end repeat
	
	return cleanText
end randomText