set pdfFileDate to date myDocName -->>invalid date and time date Sep-14-Mon TV Grid .indd of «script».
Worked in Leopard, now breaks.
Isn't it normal ?
The release notes states:
Previous versions would accept anything that looked even vaguely like a date: the string could omit components, reorder others, add or omit punctuation, and so on. In AppleScript 2.1, the string must exactly match one of the system date formats (full, long, medium, or short; see System Preferences > International > Formats for examples), including all punctuation and whitespace.
If I understand well, your file name doesn't match this requirement. The year is missing .
Well, yes, but as Chris Nebel said:
It's actually more flexible than the release notes say (they were accurate at the time). I need to confirm this with the ICU people, but it looks like it requires that the components all be present in the right order, but the punctuation and white space between them doesn't matter. For example, on my US system, "9/4/2009", "9-4-2009", and "9 4 2009" all evaluate to September 4, 2009.
I was hopeful it would continue to assume the current year, I guess not. So while some scripts will break others won't. That particular script has been in use about 8 years. Didn't even have to modify the handler for OS x or when we went to InDesign. Notice the extra space in the file name? No problem. It would also work with a number of variations in the date in the file name.
I cannot recall Apple making a change to appleScript that removed a feature (automatic coercion of dates) and broke existing scripts without warning. I can't recall a destructive change like this made with warning. Even if they're planning on removing some command from a dictionary they'll mark it as deprecated, but this is in AppleScript itself.
The good news is that now that these error messages are popping up on people's screens, they are beginning to realize they've been using appleScripts to get their work done. Of course they are now cursing applescript at the same time, but at least they know it's applescript.
I even got a call from someone I don't know running a script I had forgotten about because of this change, so it's helping me meet new people. Annoyed and frustrated people, but they'll get over it.
ES |