Re: Two quick questions
Re: Two quick questions
- Subject: Re: Two quick questions
- From: John Baltutis <email@hidden>
- Date: Fri, 23 Mar 2007 12:33:34 -0700
On 03/23/07, Bryan Lockwood <email@hidden> wrote:
>
> 1. How do I get the version of the OS?
This works for me. The first gets the OS X version info andthe second the build
into:
try
setvers to (do shell script "defaults read
/System/Library/CoreServices/SystemVersion ProductUserVisibleVersion")
end try
try
setbuild to (do shell script "defaults read
/System/Library/CoreServices/SystemVersion ProductBuildVersion")
end try
tell application "Finder"
display dialog "This computer is running" & return &return & "MacOS X
version: " & vers & return &" Build Version: " & build buttons "OK" default
button 1
end tell
>
> 2. How do I most reliably ascertain the local language. I say that because
> I've been using something like:
>
> set lang to user locale of (system info)
One of these should get what you want:
do shell script "defaults read -g | grep AppleLanguages"
do shell script "defaults read -g | grep AppleCollationOrder"
do shell script "defaults read -g | grep AppleLocale"
>
> This apparently works fine, or at least I thought so, returning things like
> "en_us" or "de_de"; however, lately it's not tracking too well. Currently
> I'm set up for German, and in fact all the menus etc. are appearing in
> German, only my technique is still returning "en_us". This is thecase on at
> least two of my machines, so I'm thinking that there must be a better way.
Note: it might be that AppleLocale refers to the language chosen (thereby
becoming the "default language") when installing OS X and can only be changed
by reinstalling and selecting another language? If so, then AppleLanguages has
no relationship to the AppleLocale and may only refer tothose used for menus,
dialogs, websites, and text processing. You'll have to experiment and see what
pops up for each.
_______________________________________________
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