• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: applescript-users digest, Vol 2 #501 - 14 msgs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: applescript-users digest, Vol 2 #501 - 14 msgs


  • Subject: Re: applescript-users digest, Vol 2 #501 - 14 msgs
  • From: Jed Verity <email@hidden>
  • Date: Thu, 15 Mar 2001 13:43:06 -0800

This is the most basic way I can think of:

--begin script
set serialCodes to {"test", "ing", "123"}

set userEntry to text returned of (display dialog "Enter Code" default
answer "")

repeat with aCode in serialCodes
if userEntry = aCode as string then
return true --the user has entered a valid code
else
false --the code is wrong
end if
end repeat
--end script

If you need to, you can read the serialCodes list in from a text file or
Excel sheet or database, etc. Or you can generate your own with a script
something like:

--begin script
property serialList : {}
property newSerialNo : {}

repeat with i from 1 to 100
set newSerialNo to {}
repeat 10 times
my RandomCharacter()
end repeat
set end of serialList to (newSerialNo as string)
end repeat

on RandomCharacter()
set randomASCII to (random number from 48 to 122)
set end of newSerialNo to ASCII character randomASCII
end RandomCharacter

serialList
--end script

HTH,
Jed

On 3/15/01 1:07 PM, you wanted me to know this:

> I have saved an applet as run-only. I would like to distribute it as a
> program.
>
> I need a way for the user to register it with a serial number (or
> string) from
> a list that I generate (of valid strings). The list could be up to 1000
> numbers.
> The number can match any in the list for the program to run.
>
> Any other way to accomplish this would fine, too.
>
> Sorry for the confusion.
> Rick
> _______________________________________________
> applescript-users mailing list
> email@hidden
> http://www.lists.apple.com/mailman/listinfo/applescript-users


~)~)~)~)~)~)~)~)~)~)~)~)~)
Jed Verity


  • Follow-Ups:
    • Re: serial codes
      • From: Emmanuel <email@hidden>
    • FW: applescript-users digest, Vol 2 #501 - 14 msgs
      • From: Jed Verity <email@hidden>
References: 
 >Re: applescript-users digest, Vol 2 #501 - 14 msgs (From: Rick Plummer <email@hidden>)

  • Prev by Date: Re: Need to translate IP addresses from hex value to dotted
  • Next by Date: Re: Cumulus Droplet with comments?
  • Previous by thread: Re: applescript-users digest, Vol 2 #501 - 14 msgs
  • Next by thread: FW: applescript-users digest, Vol 2 #501 - 14 msgs
  • Index(es):
    • Date
    • Thread