• 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: date syntax not working on 10.10.5?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: date syntax not working on 10.10.5?


  • Subject: Re: date syntax not working on 10.10.5?
  • From: "Stockly, Ed" <email@hidden>
  • Date: Wed, 19 Aug 2015 19:03:41 +0000
  • Thread-topic: date syntax not working on 10.10.5?

AppleScript used to do a remarkable job of correctly "guessing" when dates were provided in text form.

When this was "fixed," I had dozens of script's break, but this was years ago and I've done workarounds that mostly fixed it, but there are still cases where I have to have a user select a date from list or enter it in a dialog, because the guess that used to work was fixed.

These are in cases where we're gathering information from numerous sources, including files and emails, where all the various date formats people use just seemed to work, like magic with applescript. 

These scripts were installed on dozens of macs handling hundreds of dates (and times) every day (TV listings and movie release dates) and we never had a single reported error of "guessing" an incorrect date from the text. 

Whatever guesswork scripting or programming AppleScript used to do, the guessing was flawless. Although, I suppose you could intentionally craft some odd date format that would provide an incorrect result, but my scripts never encountered that in the wild. What ever algorithm was used to do the guessing was pretty good, I wish they'd release it as an OSAX or something.



Ed Stockly
LA Times 
 


From: <applescript-users-bounces+ed.stockly=email@hidden> on behalf of Michael Grant <email@hidden>
Date: Tuesday, August 18, 2015 at 7:29 PM
To: AppleScript Digest <email@hidden>
Subject: Re: date syntax not working on 10.10.5?


On Tue, Aug 18, 2015 at 8:31 PM, Shane Stanley <email@hidden> wrote:
And once you start looking at the bigger picture of how dates are formatted, let alone the fact that different calendars can be used, you realise that a scheme that once looked good to a bunch of geeks in one small geographic area doesn't fare so well in the big world. 

OK, point taken. 

 
(Also, as I pointed out, the string I was trying to use *does* match one of the formats I've got set in the preferences.)

You have no AM/PM string showing and a 24-hour clock?

That's right.

 
And lets say you do match your preferences, and it works. Then one day, for whatever reason, you decide to change your settings, or perhaps run your scripts on someone else's computer. Are you happy that they might all fail?

Well, I'm less happy that they actually are failing in the here and now....

 
Having said that, of course you should be able to make a date from a string. But you need to be able to control the format that will be used for the parsing, which standard AS doesn't let you do, or you should read the format in use (again, difficult to do in AS) and make sure the string you're parsing matches. FWIW, the former is a little easier in 10.11.

If I were boss (LOL!), I think I would have waited until those improved capabilities were in place before removing the existing functionality, however imperfect. But, OK, I s'pose I'll deal with it one way or another.

Michael



--
There's really no such thing as translating. It's all a scam. We basically just make stuff up and try to make it sound plausible.
 _______________________________________________
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: date syntax not working on 10.10.5?
      • From: Shane Stanley <email@hidden>
References: 
 >date syntax not working on 10.10.5? (From: Michael Grant <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Christopher Stone <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Michael Grant <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Shane Stanley <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Michael Grant <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: "Stockly, Ed" <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Yvan KOENIG <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Michael Grant <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Shane Stanley <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Michael Grant <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Shane Stanley <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Michael Grant <email@hidden>)

  • Prev by Date: Re: How do we Convert PICT to JPEG
  • Next by Date: Re: date syntax not working on 10.10.5?
  • Previous by thread: Re: date syntax not working on 10.10.5?
  • Next by thread: Re: date syntax not working on 10.10.5?
  • Index(es):
    • Date
    • Thread