Random alphanumeric password generator

Hello im kind of new at applescript and im trying to make (as in the title) an alphanumeric number generator, heres what i have so far

set x to {}
repeat (random number from 21 to 21) times
set end of x to some item of "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
end repeat
x as text

This works but id like to find a way to be able to attach this to the clipboard and have it show up in a dialog box ive tried the traditional methods of "set the clipboard to x" and "display dialog x"but they didnt seem to work help would be greatly appreciated
Thanks

Macbook 13.3' late 2007, Mac OS X (10.5)

Posted on Aug 4, 2009 9:12 PM

Reply
2 replies

Aug 4, 2009 9:19 PM in response to mac4life45

Use the following:

set x to ""
repeat 21 times
set x to x & some item of "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
end repeat
set the clipboard to x

You don't need to start with a list if you're only going to use it to contain one item, and you don't need to generate a random number if the same number is specified at both ends of the range.

(46142)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Random alphanumeric password generator

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.