Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting the operator's short date under Panther.



On 12/11/03 3:31 PM, "S. Elliott" <email@hidden> wrote:

> If anyone is having good success getting a correct, workable short date
> format string under Panther, if you could share your code I'd be most
> grateful.

This works under both Panther and Jaguar:


set standardDefaults to (call method "standardUserDefaults" of class
"NSUserDefaults")

set shortDateFormat to (call method "objectForKey:" of
standardDefaults with parameter "NSShortDateFormatString")



You're right that there's no longer an "NSShortDateFormatString" in
Panther's GlobalDomain, and that the AppleICUDateFormatStrings are the
location, _when the user has set a "Custom" short date_ (or any other
date/time option) in International System Prefs. But if one of the standard
localizations is taken (US, UK, French,, etc. etc.) then it's built into
localization defaults rather than specified in Global Domain. It means that
there's no way to do it in standard AppleScript - nor even in any shell
script I can find. But Objective-C NSUserDefaults still access all these
user formats just the same as they always did, so AS Studio can get at them
too by call method.

--
Paul Berkowitz
_______________________________________________
applescript-studio mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-studio
Do not post admin requests to the list. They will be ignored.

References: 
 >Getting the operator's short date under Panther. (From: "S. Elliott" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.