--[SCRIPT choose iWork's language]
(*
Save this script as an application bundle.
Store it in the Applications folder
You may install it in the Dock
If you run it, it will ask which app it must open
then which language must be used.
It will move two resources folders accordingly then will run the program in the wanted language.
As is, it assumes that the program is not already open in an other language.
Yvan KOENIG (Vallauris, FRANCE)
9 décembre 2008
*)
set p2a to path to applications folder as text
set comment to display dialog "Choose an application to open." buttons {"Keynote", "Numbers", "Pages"} default button "Pages"
set appName to button returned of comment
set p2a to p2a & appName & ".app:contents:"
set comment to display dialog "Use " & appName & " in which language ?" buttons {"Cancel", "French", "English"} default button "English"
set comment to button returned of comment
if comment is "Cancel" then error -128
if comment is "English" then
tell application "Finder"
if exists folder (p2a & "Resources:French.lproj") then move folder (p2a & "Resources:French.lproj") to folder (p2a & "Resources Disabled:")
if exists folder (p2a & "Resources Disabled:English.lproj") then move folder (p2a & "Resources Disabled:English.lproj") to folder (p2a & "Resources:")
end tell
else
tell application "Finder"
if exists folder (p2a & "Resources:English.lproj") then move folder (p2a & "Resources:English.lproj") to folder (p2a & "Resources Disabled:")
if exists folder (p2a & "Resources Disabled:French.lproj") then move folder (p2a & "Resources Disabled:French.lproj") to folder (p2a & "Resources:")
end tell
end if
tell application appName to activate
--[/SCRIPT]
Yvan KOENIG (VALLAURIS, France) jeudi 17 décembre 2009 22:14:03