Re: Getting the default language with AppleScript
Re: Getting the default language with AppleScript
- Subject: Re: Getting the default language with AppleScript
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 06 Jul 2004 11:22:38 -0700
On 7/6/04 11:01 AM, "Martin Orpen" <email@hidden> wrote:
>
on 6/7/04 6:33 pm, email@hidden at email@hidden wrote:
>
>
> At 18:49 +0200 06/07/04, Peter Fischer wrote:
>
>> The single line:
>
>
>
>> set theLang to (do shell script "defaults read com.apple.dock.loc")
>
>
>
>> should give you a result like "en_US", "fr_FR" or "de_DE" and so on...
>
>
>
> 10.3.4 here, Terminal 1.4.3, tcsh:
>
>
>
> ~ : defaults read com.apple.dock.loc
>
> 2004-07-06 19:16:43.826 defaults[10974]
>
> Domain com.apple.dock.loc does not exist
>
>
Try:
>
>
$ defaults read com.apple.systempreferences AppleIntlCustomFormat
That's promising. As 'do shell script':
"{
AppleCurrencySymbol = \"\\\\U20ac\";
AppleDateOrder = 1;
AppleDecimalSeparator = \",\";
AppleIntlCustomICUFormats = 7;
AppleIntlCustomLocale = \"en_US\";
AppleIntlCustomResID = 16383;
AppleLongDateSeparator3 = \".\";
AppleMetricSystem = 0;
AppleShortDateFormat = 224;
AppleShortDateSeparator = \".\";
AppleThousandSeparator = \".\";
AppleTimeCycle = 0;
}"
>
>
Or this:
>
>
$ defaults read com.apple.systempreferences AppleIntlCustomFormat | awk
>
'/Locale/ { print $NF }'
Even more promising:
"\"en_US\";"
set theLang to (do shell script "defaults read
com.apple.systempreferences AppleIntlCustomFormat | awk '/Locale/ { print
$NF }'")
set theLang to (text 2 thru -3 of theLang)
--> "en_US"
--
Paul Berkowitz
_______________________________________________
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.