Created
November 22, 2011 05:20
-
-
Save epetousis/1384963 to your computer and use it in GitHub Desktop.
A AppleScript to generate a password.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repeat | |
set passwrd to {} | |
display dialog "How many characters do you want this password to have? NOTE: Don't enter anything other than a number." default answer "64" buttons {"This amount"} | |
set char_amnt to text returned of result | |
repeat (char_amnt) times | |
set end of passwrd to some item of "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" | |
end repeat | |
display dialog "Your password is:" default answer passwrd as string buttons {"Copy to clipboard and quit", "Another one"} | |
set the_button to button returned of result | |
if the_button is "Copy to clipboard and quit" then | |
tell application "Finder" to set the clipboard to passwrd as text | |
error number -128 | |
end if | |
end repeat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment