• 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: Walter Ian Kaye <email@hidden>
  • Date: Tue, 3 Feb 2004 10:26:43 -0800

At 10:01a -0700 02/03/2004, Robert Poland didst inscribe upon an electronic papyrus:

Why doesn't this script work?

set nowDate to (current date)
set nowTime to "" & time string of (nowDate)
set bedTime to "8:59.00 PM" as text --> "8:59.00 PM"
set nowTime to nowTime as text --> "9:57:26 AM"
if (nowTime is less than bedTime) then
set x to 1
else
set x to 2
end if
x --> 2

Is this copy/pasted from your script? You have a period instead of a colon.
Also, you are only comparing text strings, not time values, so 1:00 PM will appear to be less than 12:00 PM.
_______________________________________________
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: Multiline commands in do shell script
  • Next by Date: Grab list of album names in iTunes?
  • Previous by thread: Re: Applescript can't tell time?
  • Next by thread: Summary: Applescript can't tell time?
  • Index(es):
    • Date
    • Thread