• 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: check list routine, was (applescript-users digest, Vol 2 #501 - 14 msgs)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: check list routine, was (applescript-users digest, Vol 2 #501 - 14 msgs)


  • Subject: Re: check list routine, was (applescript-users digest, Vol 2 #501 - 14 msgs)
  • From: "Arthur J Knapp" <email@hidden>
  • Date: Fri, 16 Mar 2001 12:46:31 -0500

> Date: Thu, 15 Mar 2001 13:43:06 -0800
> From: Jed Verity <email@hidden>


> 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

Good stuff. :)


I have slightly speeded up your script by rewritting
RandomCharacter(). This way, you can avoid those 2000
osaxen calls:

-- ASCII characters 48 thru 122.
--
-- You can just type out sSerialChars as a literal
-- string, (I just wanted to avoid the linebreak
-- issue).
--
property sUpperC : "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
property sLowerC : "abcdefghijklmnopqrstuvwxyz"
property sDigits : "0123456789"
property sSymbol : ":;<=>?@[\\]^_`"
--
property sSerialChars : sUpperC & sLowerC & sDigits & sSymbol

on RandomCharacter()

set end of newSerialNo to some item of sSerialChars

end RandomCharacter


Arthur J. Knapp
http://www.stellarvisions.com
mailto:email@hidden

Hey, check out:
http://www.LateNightSW.com


  • Prev by Date: Re: Identifying text boxes by a name in Quark
  • Next by Date: Re: Choose file/folder command
  • Previous by thread: <ANN> Mascripter's Magazine 4oh
  • Next by thread: Multiple Users - Script Problem
  • Index(es):
    • Date
    • Thread