Re: Getting the default language with AppleScript
Re: Getting the default language with AppleScript
- Subject: Re: Getting the default language with AppleScript
- From: Paul Skinner <email@hidden>
- Date: Sun, 25 Jul 2004 14:55:28 -0400
Or, for those without satellite imaging... ; )
on UserLanguage()
set x to system attribute "LANG"
if x is "" then
set {prevdelim, AppleScript's text item delimiters} to {AppleScript's
text item delimiters, "_"}
set x to text item 1 of (do shell script "defaults read -g
AppleLocale")
set AppleScript's text item delimiters to prevdelim
end if
return x
end UserLanguage
On Jul 25, 2004, at 10:51 AM, Emmanuel wrote:
So far, my proposition is:
------------------------
on UserLanguage()
set x to system attribute "LANG"
if x = "" then set x to do shell script "defaults read -g AppleLocale"
find text "^[^_]+" in x with regexp and string result
end UserLanguage
------------------------
Emmanuel
_______________________________________________
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.