• 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: Revisited: date/Snow Leopard changed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Revisited: date/Snow Leopard changed


  • Subject: Re: Revisited: date/Snow Leopard changed
  • From: Robert Poland <email@hidden>
  • Date: Sat, 5 Sep 2009 17:53:08 -0600


On Sep 5, 2009, at 5:14 PM, Michelle Steiner wrote:


On Sep 5, 2009, at 3:00 PM, Robert Poland wrote:

set y to "9/9"
set PictureDate to short date string of date y
y

With Leopard this used to give me a result of 9/9/09. In Snow Leopard it gives me the error; Can't get short date string of "9/9".

Looks like "short date string" was a part of standard additions in the past.

What replaced it.

The problem isn't with "short date string", but that "9/9" isn't a valid input for a date.

set y to "9/9"
date y

--> error "Invalid date and time date 9/9 of «script»." number -30720

You have to provide month, day, and year, in one of the formats specified in the Language & Text System Preferences.


Ok Michelle, Here's the portion of the script I have been using for ages. It would accept either 9/9, 9/9/09.

set dateFlag to false
set PictureDate to (short date string of ((current date) - (1 * days))) --> "1/29/06"

repeat while dateFlag ≠ true
tell application "System Events"
activate
set x to display dialog "This is the date that will be used. " & return & PictureDate default answer "" buttons {"OK", "No", "NO Date"} default button 1
end tell


set y to text returned of result
set x to button returned of x


if x = "OK" then
if y ≠ "" then
set PictureDate to short date string of date y
else
set dateFlag to true
end if
else
if x = "NO Date" then
set PictureDate to ""
set dateFlag to true
end if
end if
end repeat


Bob Poland - Fort Collins, CO



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Revisited: date/Snow Leopard changed
      • From: Michelle Steiner <email@hidden>
References: 
 >date/Snow Leopard changed (From: Robert Poland <email@hidden>)
 >Re: date/Snow Leopard changed (From: Yvan KOENIG <email@hidden>)
 >Re: date/Snow Leopard changed (From: Robert Poland <email@hidden>)
 >Revisited: date/Snow Leopard changed (From: Robert Poland <email@hidden>)
 >Re: Revisited: date/Snow Leopard changed (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Revisited: date/Snow Leopard changed
  • Next by Date: Re: Revisited: date/Snow Leopard changed
  • Previous by thread: Re: Revisited: date/Snow Leopard changed
  • Next by thread: Re: Revisited: date/Snow Leopard changed
  • Index(es):
    • Date
    • Thread