• 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: Just screwing around
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Just screwing around


  • Subject: Re: Just screwing around
  • From: Nigel Garvey <email@hidden>
  • Date: Tue, 26 Nov 2002 00:16:37 +0000

Michelle Steiner wrote on Mon, 25 Nov 2002 15:31:07 -0700:

>screw(the current date)
>
>on screw(Input)
> set the day of the Input to random number from 1 to 28
> set the year of the Input to random number from 1700 to 2400
> set the month of the Input to some item of {January, February, March,
>April, May, June, July, August, September, October, November, December}
> return the Input
>end screw

Another way to get a random date in this range - if you didn't want to
exclude the possible days 29 to 31 and also wanted to randomise the time
- would be:

screw()

on screw()
date "Thursday, 31 December 1699 23:59:59"
return result + (random number from 1 to ((date "Sunday, 31 December
2400 23:59:59") - result))
end screw

Is this more, or less random than Michelle's script?

NG
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: [OT] Just screwing around
      • From: Emmanuel <email@hidden>
  • Prev by Date: Re: Getting droplets to accept text/image clippings
  • Next by Date: Re: lock the screen from the keyboard, win a prize
  • Previous by thread: Just screwing around
  • Next by thread: Re: [OT] Just screwing around
  • Index(es):
    • Date
    • Thread