System Language
Version: 1.1
System Language is an extension to Applescript that allows a scripter to determine in his script what language is being used by the system on which the script is running. A numerical language code, or the name of the language in plain text is returned based on how System language is called by the scripter. One possible use of System Language might be to allow scripts to automatically detect and adjust to running on systems in different languages.
System Language does not use the standard scripting addition mechanism. Instead, System Language is packaged as a scriptable faceless background application. While System Language is running, it is not displayed in the Application Switcher menu, and does not have a user interface. This type of packaging offers many benefits over the traditional scripting addition packaging:
Packaging
System Language is provided in two different formats: Application, and Extension. Each of these have different behaviors (outlined below), but only differ slightly at the file level. The way the two files differ at the file level is that the Application file has a file type of "APPL", while the Extension file has a file type of "appe". While this difference may appear to be subtle, the resulting differences in behavior are not subtle. Based on your individual needs, you should use the format that suits you best.
Application
The Application format (file type "APPL") behaves as a normal application, in that you can double-click the file to launch it. However, you cannot place it into the Extensions folder to have it automatically start up when the system starts up, and shut down when the system shuts down. Note that since System Language is a faceless background application, it has no menus. Therefore you must send it an Applescript "quit" command in order to quit it.
Extension
The Extension format (file type "appe") cannot be double-clicked to launch it, and appears to be a system extension. When placed into the Extensions folder, it automatically starts up when the computer starts up, and shuts down when the computer shuts down. Note that since System Language is a faceless background application, it has no menus. Therefore you must send it an Applescript "quit" command in order to quit it.
Installation
Installation is different depending on the format being installed:
Application
To install the System Language application, drag it to any place on your hard drive. The first time you call the System Language application in a script, Applescript may ask you to locate the application file.
Extension
To install the System Language extension, place the extension into the Extensions folder of the System Folder on the active startup disk. When placed in the Extensions folder, System Language loads automatically when the Mac OS starts up, and closes when the Mac OS shuts down or restarts.
Using System Language
To view the dictionary, drag System Language over a script editor. The System Language dictionary looks like this:
System Language : Returns the language code for the current system script.
Commands intended for System Language processing must be enclosed in a tell block like so:
tell application "System Language"
return the System Language with name
end tell
The "with name" clause instructs System Language to return a textual name rather than a numerical language code.
Version History
1.1
Removed GNU General Public License. System Language is now copyrighted freeware.
1.0
Initial release.
Copyright © 1997-2003 David Blache, Microcosm Software.
All rights reserved. Any unauthorized reproduction is prohibited.
Other names, marks and products are the property of their respective holders.