Sunday, June 25, 2017

#1 2002-10-08 11:10:25 pm

Bill Cheeseman
Administrator
Registered: 2006-06-29
Posts: 158

AppleScript 1.8.1 (Mac OS X 10.1.2 Puma) {no OS 9 ver.}

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.

Offline

 

#2 2002-10-08 11:12:59 pm

Bill Cheeseman
Administrator
Registered: 2006-06-29
Posts: 158

Re: AppleScript 1.8.1 (Mac OS X 10.1.2 Puma) {no OS 9 ver.}

DOCUMENTATION FOR NEW APPLESCRIPT FEATURES

Apple published the AppleScript 1.8.1 for Mac OS X 10.1.2 - Release Notes shortly after the release of Mac OS X 10.1.2. At this writing, it is available as AppleCare KnowledgeBase Document 75206. 10/8/02

The AppleScript Studio documentation, including the new volume of Inside Mac OS X and release notes, is also available online.

Offline

 

#3 2002-10-08 11:17:50 pm

Bill Cheeseman
Administrator
Registered: 2006-06-29
Posts: 158

Re: AppleScript 1.8.1 (Mac OS X 10.1.2 Puma) {no OS 9 ver.}

TESTING WHETHER APPLESCRIPT 1.8.1 IS INSTALLED

We have said in every one of our reports on successive AppleScript versions in the Mac OS that, before using new features of AppleScript, careful writers of scripts intended for public distribution will want to determine which version of AppleScript is present on the user's machine.

A good, universal way to determine whether AppleScript 1.8.1 is available is to use the following script:

Applescript:


on AppleScript181orNewer()
   tell application "Finder"
       to get system attribute "ascv"
    return (result is greater than or equal to 17826177)
end AppleScript181orNewer


Filed under: Finder

Offline

 

#4 2002-10-08 11:19:29 pm

Bill Cheeseman
Administrator
Registered: 2006-06-29
Posts: 158

Re: AppleScript 1.8.1 (Mac OS X 10.1.2 Puma) {no OS 9 ver.}

APPLESCRIPT TOOLS, SCRIPTING ADDITIONS, AND SCRIPTABLE APPLICATIONS

Scriptable components of Mac OS X remain unchanged except as noted here.

Finder 10.1.2
The dictionary of Finder 10.1.2, found in /System/Library/CoreServices/, appears to be unchanged. All of the items formerly marked NOT AVAILABLE are still unavailable.

Interface Builder 2.2 (v248)
Interface Builder was upgraded to version 2.2 (v248) from 2.1 by the December 2001 Developer Tools quarterly CD.

Internet Explorer 5.1.3 (3905)
The Microsoft Internet Explorer application comes with Mac OS X. It is currently at version 5.1.3 (3905), up from 5.1.2 (3707), but I didn't check to see whether this was the result of installing Mac OS X 10.1.2 or installing IE separately.

Project Builder 1.1.1
Project Builder was upgraded to version 1.1.1 from 1.1 by the December 2001 Developer Tools quarterly CD.

SpeechRecognitionServer 3.0.2
SpeechRecognitionServer 3.0.1 has been upgraded to version 3.0.2. It
includes Speech Listener and Continuous Speech Listener, allowing your
scripts to listen for and respond to spoken commands. It remains at this rather daunting address:
/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.
framework/Versions/A/Resources/SpeechRecognitionServer

This is now workable, however, because both SpeechRecognitionServer and SpeakableItems appear in the list of scriptable software when you use Script Editor to open dictionaries. Scripting it is easy; just 'tell application SpeechRecognitionServer to', although its dictionary is entitled Speech Recognition Server Dictionary (with spaces).

Standard Additions 1.8.1
The Standard Additions scripting addition is upgraded to version 1.8.1 from version 1.7. Its new features are described above.

Standard Additions no longer offers the Folder Actions commands, presumably because Folder Actions capability is still missing from Finder 10.1. I hope this does not mean that Folder Actions will never be implemented in Mac OS X.

StuffIt Expander 6.5.1
Aladdin Systems' StuffIt Expander application is up to version 6.5.1 from 6.0.1. I don't recall whether it was intalled by the Mac OS X 10.1.2 updater, but it is available for free from Aladdin Systems, in any event.

Offline

 

#5 2002-10-08 11:22:25 pm

Bill Cheeseman
Administrator
Registered: 2006-06-29
Posts: 158

Re: AppleScript 1.8.1 (Mac OS X 10.1.2 Puma) {no OS 9 ver.}

FIXED BUGS

A list of thirteen fixed AppleScript-related bugs in AppleScript 1.7 for Mac OS X is available in Apple's AppleScript 1.8.1 for Mac OS X 10.1.2 - Release Notes and will not be repeated here.

Offline

 

#6 2002-10-08 11:24:30 pm

Bill Cheeseman
Administrator
Registered: 2006-06-29
Posts: 158

Re: AppleScript 1.8.1 (Mac OS X 10.1.2 Puma) {no OS 9 ver.}

NEW (AND OLD) BUGS

AppleScript 1.8 breaks the Mac OS X-native version of Script Debugger. Preliminary reports from users suggest that AppleScript 1.8.1 may have fixed this, but the final verdict is not yet in. According to the release notes, The only difference is that the problem of applets crashing when certain multimedia software is installed is fixed in version 1.8.1, and it states that there are some incompatibilities with third-party script editors.

A list of unresolved issues in AppleScript 1.8.1 appears in Apple's AppleScript 1.8.1 for Mac OS X 10.1.2 - Release Notes and will not be repeated here.

Offline

 

#7 2002-10-08 11:05:30 pm

Bill Cheeseman
Administrator
Registered: 2006-06-29
Posts: 158

Re: AppleScript 1.8.1 (Mac OS X 10.1.2 Puma) {no OS 9 ver.}

Mac OS X 10.1.2 was released via the Software Update preference pane in mid-December 2001, and standalone updaters were released a few days later in the form of a combo updater from Mac OS X 10.1 or 10.1.1 and a regular updater from Mac OS X 10.1.1. It includes AppleScript 1.8.1 for the native Mac OS X environment, and Standard Additions 1.8.1. Script Editor remains at version 1.7. The Mac OS X 10.1.2 updater does not update AppleScript for the Classic environment, which remains at version 1.7 if you applied the Mac OS 9.2.2 update released just a couple of weeks earlier. Mac OS 9 does not have a corresponding upgrade to AppleScript 1.8.1, either.

This is a dot-dot release and therefore contains relatively few new features or feature changes. As a result, this report is relatively short.

Like the reports on previous versions of AppleScript, this report is based on information obtained from various sources, including official Apple publications and several AppleScript and Mac OS X mailing lists and news groups, and my own investigations. It includes information I have dug out of the product itself, as installed on my own computers.

AppleScript Studio
The star attraction of Mac OS X 10.1.2 is AppleScript Studio, which requires AppleScript 1.8 or newer. The initial public release of AppleScript Studio came shortly before the release of Mac OS X 10.1.2, to Apple Developer Connection members (including free members), along with AppleScript 1.8, on the December 2001 Developer Tools quarterly CD. AppleScript Studio applications require at least Mac OS X 10.1.1 and the December 2001 Developer Tools, or Mac OS X 10.1.2, in order to run. Development of AppleScript Studio applications requires either version of Mac OS X and the Developer Tools.

AppleScript Studio is an enhancement to Apple's existing developer tools, Project Builder and Interface Builder, incorporating AppleScript as a supported language for development along with C, Objective-C, C++, and Java. In addition to a new applescript.component file, it adds a new AppleScriptKit.framework to the system frameworks, source for a number of example applications, and a new volume of Inside Mac OS X devoted to AppleScript Studio. Using these tools, knowledgeable developers can build full-fledged Cocoa applications that run natively on Mac OS X using AppleScript. Among the many attractions of AppleScript Studio are the ability to include a complete Aqua-compliant application user interface using the visual design tools of Interface Builder, professional-level debugging using the debugger that comes with Project builder, and Project Builder's powerful editing capabilities, including text files that are not constrained by Script Editor's 32K limit, find and replace, and drag and drop editing. Using AppleScript entails trade-offs, of course, and Apple warns that AppleScript Studio may not be an appropriate development environment for applications that do, for example, intensive data processing or that manage large amounts of data.

AppleScript Studio is not for beginning scripters, and even experienced scripters will find that a fairly deep understanding of the Cocoa frameworks is required to get past the simplest tasks. The documentation, though excellent, falls short in explaining Cocoa technology, so newcomers to Cocoa will quickly find that they have to begin wading through the voluminous techical documentation for Cocoa developers. It is a developer's tool, aimed not only at advanced AppleScripters who need to incorporate a full user interface into their AppleScript solutions, but also at Cocoa developers who can meld AppleScript into applications that are otherwise based primarily on Objective-C. It also adds comprehensive AppleScript support for scripting the user interface of Cocoa applications in which AppleScript support is turned on.

Apple's Script Editor and the third-party scripting solutions such as Scripter, Script Debugger, Smile, and FaceSpan, will continue to play an important role in the AppleScript community. For one thing, AppleScript Studio requires Mac OS X; it cannot be used in the classic Mac OS, where Script Editor or one of the third-party products is therefore still required to work with AppleScript. More importantly, AppleScript Studio does not produce compiled scripts, but applications. There remain a great many situations wherein a compiled script, whether simple or complex, or even an AppleScript application that does not require a comprehensive user interface, can be more easily developed using Script Editor or a third-party tool. Script Editor, Script Debugger, and Smile are already available in Mac OS X-native versions. Finally, FaceSpan, if it is ported to Mac OS X as rumored, will likely offer some advantages over AppleScript Studio, including what I feel is, in its classic Mac OS incarnation, a more thoroughly object-oriented graphical user interface builder. FaceSpan is a third-party AppleScript application development environment that was originally distributed by Apple as Frontmost in 1993 with early releases of AppleScript.

Third-party Web sites relating to AppleScript Studio are already starting to crop up. One is Cole McDonald's AppleScript Studio Tutorial, each page showing how to perform a specific task. 10/18/02

I cover AppleScript Studio in greater depth in another forum, MacTech Magazine, which published the following articles I wrote about AppleScript Studio: AppleScript Studio: An Introduction, MacTech Magazine, Vol. 18, No. 1 (January 2002); AppleScript Studio: Implementing an Application Preferences System, MacTech Magazine, Vol. 18, No. 5 (May 2002); and AppleScript Studio: Implementing a Document-Based Application, MacTech Magazine, Vol. 18, No. 7 (July 2002). The project source files for the Doyle application described in the last two articles can be downloaded here. 10/8/02

Offline

 

Board footer

Powered by FluxBB

[ Generated in 0.034 seconds, 8 queries executed ]

RSS (new topics) RSS (active topics)