Re: applescript-users digest, Vol 2 #501 - 14 msgs
Re: applescript-users digest, Vol 2 #501 - 14 msgs
- Subject: Re: applescript-users digest, Vol 2 #501 - 14 msgs
- From: Michelle Steiner <email@hidden>
- Date: Thu, 15 Mar 2001 15:34:22 -0800
On 3/15/01 1:07 PM, Rick Plummer <email@hidden> wrote:
>
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.
So, the list of serial number strings will be embedded in the applet? In
this case, the following should do it for you:
property valid : false
property validNumbers : {"1", "2", "3", "4", "5", "6", "7", "8", "9",
"10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21",
"22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33",
"34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45",
"46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57",
"58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69",
"70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "80", "81",
"82", "83", "84", "85", "86", "87", "88", "89", "90", "91", "92", "93",
"94", "95", "96", "97", "98", "99", "100"}
if not valid then
set valid to my validatetheEntry()
if valid then my dostuff()
else
my dostuff()
end if
to validatetheEntry()
set enteredText to text returned of (display dialog "Please enter your
serial number." default answer "")
if enteredText is in validNumbers then
set valid to true
else
display dialog "That is not a valid serial number. Try again?" buttons
{"Try Again.", "Not now."} default button 1 with icon note
if button returned of the result is "Try Again." then
validatetheEntry()
else
set valid to false
end if
end if
end validatetheEntry
on dostuff()
beep 3
end dostuff
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------