• 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 can't tell time?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Applescript can't tell time?


  • Subject: Re: Applescript can't tell time?
  • From: Michelle Steiner <email@hidden>
  • Date: Tue, 3 Feb 2004 10:36:00 -0700

On Feb 3, 2004, at 10:01 AM, Robert Poland wrote:

Why doesn't this script work?


Because you're comparing strings, not dates. A string beginning with "8" is always less than a string beginning with "9".

Try this script instead:

set nowTime to (current date)
set bedTime to date (date string of nowTime & ":8:59: PM")

if nowTime is less than bedTime then
set x to 1
else
set x to 2
end if

--
"To announce that there must be no criticism of the president, or that we are to stand by the president right or wrong, is not only unpatriotic and servile, but is morally treasonable to the American public." --Teddy Roosevelt
_______________________________________________
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.
References: 
 >Applescript can't tell time? (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: Command Line Fix for Locked Files?
  • Next by Date: Re: Applescript can't tell time?
  • Previous by thread: Applescript can't tell time?
  • Next by thread: Re: Applescript can't tell time?
  • Index(es):
    • Date
    • Thread