Skip to content

Instantly share code, notes, and snippets.

@atroia
Last active February 26, 2025 23:21
Show Gist options
  • Save atroia/a30e0c41ebf35ab3b9a2e27be54983bf to your computer and use it in GitHub Desktop.
Save atroia/a30e0c41ebf35ab3b9a2e27be54983bf to your computer and use it in GitHub Desktop.
10 digit code generator
set theButton to button returned of (display dialog "10 digit code: " & randomNum() buttons {"Refresh", "Cancel", "OK"} with title ("10 Digit Code Generator"))
if theButton is "Refresh" then my repeatNum()
on randomNum()
set x to random number from 10000 to 99999
set y to random number from 10000 to 99999
set returnNum to (x & "-" & y) as text
end randomNum
on repeatNum()
set theButton to button returned of (display dialog "10 digit code: " & randomNum() buttons {"Refresh", "Cancel", "OK"} with title ("10 Digit Code Generator"))
if theButton is "Refresh" then my repeatNum()
end repeatNum
@atroia
Copy link
Author

atroia commented Feb 26, 2025

Initial Commit

@atroia
Copy link
Author

atroia commented Feb 26, 2025

added title to display dialog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment