NEW FEATURES, CHANGES, AND LIMITATIONS IN APPLESCRIPT 1.8.1
In addition to AppleScript Studio, Mac OS X 10.1.2 features a new Do Shell Script command for scripting UNIX shell commands and scripts, complete with the ability to specify access as administrator and to provide an administrator password in order to avoid a dialog. In addition, the System Attribute command now optionally accepts a shell environment variable as a parameter instead of a Gestalt selector, to provide information about a user’s environment. If no parameter is provided, a list of environment variables is returned (namely, {HOME, SHELL, USER, LANG, PATH, __CF_USER_TEXT_ENCODING}). For example, ‘system attribute SHELL’ returns /bin/tcsh. These changes appear in the new version 1.8.1 of the Standard Additions scripting addition.
A new POSIX File class has also been added to Standard Additions 1.8.1, allowing you to obtain an AppleScript file object by passing in a slash-delimited UNIX path in the POSIX style recognized by shell commands and scripts, instead of the colon-delimited path normally required by AppleScript. This new class includes a POSIX Path property that returns a slash-delimited POSIX path for use with the Do Shell Script command. The AppleScript language has been enhanced so that all file and alias references work with the new POSIX File class. This allows easy conversion of a slash-delimited UNIX path to a colon-delimited AppleScript path, and vice versa. This is quite useful in AppleScript Studio, where the Path For command and many properties giving the locations of files within application bundles return slash-delimited paths that aren’t recognized by AppleScript commands unless converted using the POSIX Path class.