•AppleScript 1.3 Feature History AppleScript SDK January 22, 1999   New features in AppleScript 1.3.4 No new features. AppleScript 1.3.4 loads only on Mac OS 8.5 and later. New features in AppleScript 1.3.3 AppleScript 1.1.3 is a special release that loads only in the Mac OS 8.1-based Blue Box on Mac OS X Server.   New features in AppleScript 1.3.2 AppleScript 1.3.2 is AppleScript 1.3 with one bug fix.   New features in AppleScript 1.3 Packaging and Loading AppleScript 1.3 loads only on Mac OS 8.5 and later. The AppleScript extension was renamed from ŒAppleScript¹ to eliminate the high-ASCII character in its name. AppleScript 1.3 requires AppleEvent Manager 1.0.5, which is built in to the System file in Mac OS 8.5. It now no longer installs its own copy of AppleEvent Manager 1.0.4 at system startup time. As of AppleScript 1.3, the English Dialect is the only supported dialect. While the mechanism to support alternate dialects has not been removed, versions of the Japanese Dialect, French Dialect, and Italian Dialect have not been produced for AppleScript 1.3, and there are no plans to support them or other dialects in the future. Non-English versions of AppleScript are localized in that the comments in terminology resources are translated into the local language, but terms are not localized. Native AppleScript AppleScript 1.3 is native Power PC code and is significantly faster than the previous version when running on Power PC-based Macintosh models. The core of the AppleScript compiler, decompiler, and bytecode execution engine, the English dialect, the built-in coercion and event handlers, the Applet Shell component, and the systemwide OSAX master loader and Œgdut¹ handlers are all native. The only 68K code is the boot-time INIT code. The OSAX loading mechanism was modified to support loading scripting additions from CFM shared library files. This mechanism is going to be different in future versions of AppleScript and will not be documented in this SDK. Consolidated, Native Scripting Additions The following standard scripting additions delivered with AppleScript have been converted to native Power PC code and consolidated into the ³Standard Additions² scripting addition: Beep Choose Application Choose File Current Date Display Dialog File Commands Load Script Numerics String Commands Read/Write Commands Run Script Store Script Time To GMT New and Revised Scripting Additions Several new scripting addition commands are added: delay: Pause for a fixed amount of time delay integer -- the number of seconds to delay Waits for a given number of seconds. You can write delay 5*minutes or use the other built-in time multipliers if you choose. The cursor does not spin during a delay, and mouse clicks will not change to other applications, but background tasks do get time. Note: While the terminology for ³delay² is in the Standard Additions file, the implementation is in the AppleScript core itself, not in a system event handler. say: Speak the given text say anything -- the text to speak, which can include intonation characters [displaying string] -- the text to display in the feedback window (if different) [using string] -- the voice to speak with If PlainTalk Text To Speech is installed and enabled, this command speaks the given text. The text can be encoded using the modifiers that change the intonation and interpretation of the text; see the Text to Speech documentation. The optional parameter using is the name of a voice in the Voices folder with which to speak. If Speech Recognition is installed and enabled, the text spoken is also shown in the Speech Recognition window; the optional parameter display allows you to supply alternate text in case the main text is encoded with intonation characters. summarize: Summarize the specified text or text file summarize anything -- the text (or an alias or file specificiation of a text file) to summarize [in integer] -- the number of sentences desired in the summary Result: string -- a summarized version of the text or file If Find by Content is installed, summarizes the given text (either as an alias or text string) into the number of sentences provided in the required second parameter. set the clipboard to: Place data on an application¹s clipboard. Use inside a Œtell¹ block and activate the application first set the clipboard to anything -- the data to place on the clipboard the clipboard: Return the contents of an application¹s clipboard. Use in a Œtell¹ block after activating the application the clipboard [as type class] -- the type of data desired Result: anything -- the data from its clipboard clipboard info: Return information about the clipboard clipboard info [for type class] -- restricts to information about only this data type Result: list -- one list of {data type, size} for each type of data on the clipboard These commands are from Jon¹s Commands, and they manipulate the clipboard in a target application. Note that the Clipboard commands must be executed after an activate command inside the Tell block for a target application in order to be effective. mount volume: Mount the specified AppleShare volume mount volume string -- the name or URL path (starting with Œafp://¹) of the volume to mount on server string -- the server on which the volume resides [in AppleTalk zone string] -- the AppleTalk zone in which the server resides [as user name string] -- the user name with which to log in to the server; omit for guest access [with password string] -- the password for the user name; omit for guest access Mounts a volume in the File System. If the direct parameter is a volume name (not terminated with a colon) and the on server and optional in AppleTalk zone, as user name, and with password properties are provided, the server is mounted using the AppleTalk Filing Protocol over the AppleTalk network. If the direct parameter is a URL of an AppleShare IP file server in the form ³afp://appleshareipserver.mycompany.com², the server is mounted over Internet Protocol. Note that the remaining parameters are ignored in the case of IP volumes; to supply user name and password information, they must be supplied in the URL in the form ³afp://username:password@appleshareipserver.mycompany.com². choose from list: Allows user to select an item from a list of strings choose from list list -- a list of strings to display (an empty list if no selection) [with prompt string] -- the prompt to appear at the top of the list selection dialog [default items list] -- list of strings to initially select [OK button name string] -- the name of the OK button [cancel button name string] -- the name of the Cancel button [multiple selections allowed boolean] -- Allow multiple items to be selected? [empty selection allowed boolean] -- Can the user make no selection and then choose OK? Result: list -- the list of strings chosen Presents a dialog box with a list of items given in the direct parameter. The dialog box has an optional title, and any items provided in the default items parameter are initially highlighted. The OK and Cancel button names can be set individually. The two booleans control multiple selections and the ability to dismiss the box without making any selection. The result is a list of one or more items from the original list. This functionality is taken from the GTQ Scripting Additions. display dialog: Display a dialog box, optionally requesting user input display dialog string -- the text to display in dialog box [default answer string] -- the default editable text [buttons list] -- a list of up to three button names [default button number or string] -- the name or number of the default button [with icon number or string] -- the name or ID of the icon to displayŠ [with icon stop/note/caution] -- Šor one of these system icons [giving up after integer] -- number of seconds to wait before automatically dismissing dialog Result: dialog reply -- a record containing the button clicked and text entered (if any) Class dialog reply: Reply record for display dialog command Properties: button returned string [r/o] -- name of button chosen (empty if Œgiving up after¹ was supplied and dialog timed out) text returned string [r/o] -- text entered (present only if Œdefault answer¹ was supplied) gave up boolean [r/o] -- did the dialog time out? (present only if Œgiving up after¹ was supplied) The Display Dialog command is enhanced in AppleScript 1.3 with the addition of the giving up after parameter. If this optional parameter is provided and the user fails to click any button to dismiss the dialog within the given number of seconds, the dialog is automatically dismissed. In that case the dialog reply has an additional record field, gave up, with a value of true. path to: Returns full path name to the folder or application specified path to apple menu/application support/control panels/control strip modules/desktop/desktop pictures folder/extensions/Folder Action scripts/fonts/help/launcher items folder/modem scripts/plugins/preferences/printer descriptions/printer drivers/printmonitor/... -- the folder or application to return [as type class] -- the type to return: alias, file specification, or string Result: alias -- the path name to the folder or application specified Even more special folders have been defined in Mac OS 8.5, and selectors for those items have been added to the Path To command. Because of the extremely large number of items in this enumeration, many of the synonyms or lesser-used selectors have been moved to a hidden enumeration, so they can still compile and decompile, but are not shown in the command. New and Reorganized Terminology The AppleScript English Dialect¹s Œaeut¹ resource was significantly reworked. The Required Suite was removed, several changes were made to the Standard Suite, a number of classes were added to the AppleScript and Type Names suites, classes were moved among suites, corrections were made in type values for class properties, etc. See the document ³Changes in the AEUT² in this SDK for complete details. Macintosh Connectivity Classes A set of classes have been added to support specification of devices and connectivity. The terminology for these classes is provided as an optional suite in the AppleScript English Dialect Œaeut¹ resource. For detailed information on the Connectivity Classes, see the ³Macintosh Connectivity Classes² document in this SDK. Internet Suite A set of events and classes have been added to support access to and specification of Internet data types. Several event and coercion handlers are provided in the Standard Additions file to support these events and classes, and the terminology is provided in Standard Additions for these events and classes. For detailed information on the Connectivity Classes, see the ³About the Internet Suite² document in this SDK. Unicode, Pascal and C String Support Several new string classes to support text encoded in the Unicode standard have been added. Terminology for these classes is provided in the AppleScript suite in the AppleScript English Dialect¹s Œaeut¹ resource, and coercion handlers are provided in the AppleScript extension to handle common coercions. For detailed information on the Unicode and String types, see the document ³String Coercions in AS 1.3² in this SDK. Unit Coercions A new mechanism for unit coercions is introduced in AppleScript 1.3. Basic unit types are provided in the AppleScript Œaeut¹ resource, and coercion handlers are provided to convert from numbers to and from these types, and to coerce among related types. The mechanism is extensible so that scripting additions or applications can add new unit types and conversions to all other supported types. "metres", typeMeters, "a distance measurement in SI meters" "meters", typeMeters, "a distance measurement in SI meters" "inches", typeInches, "a distance measurement in Imperial inches" "feet", typeFeet, "a distance measurement in Imperial feet" "yards", typeYards, "a distance measurement in Imperial yards" "miles", typeMiles, "a distance measurement in Imperial miles" "kilometres", typeKilometers, "a distance measurement in SI kilometers" "kilometers", typeKilometers, "a distance measurement in SI kilometers" "centimetres", typeCentimeters, "a distance measurement in SI centimeters" "centimeters", typeCentimeters, "a distance measurement in SI centimeters" "square metres", typeSquareMeters, "an area measurement in SI square meters" "square meters", typeSquareMeters, "an area measurement in SI square meters" "square feet", typeSquareFeet, "an area measurement in Imperial square feet" "square yards", typeSquareYards, "an area measurement in Imperial square yards" "square miles", typeSquareMiles, "an area measurement in Imperial square miles" "square kilometres", typeSquareKilometers, "an area measurement in SI square kilometers" "square kilometers", typeSquareKilometers, "an area measurement in SI square kilometers" "litres", typeLiters, "a volume measurement in SI liters" "liters", typeLiters, "a volume measurement in SI liters" "gallons", typeGallons, "a volume measurement in Imperial gallons" "cubic metres", typeCubicMeters, "a volume measurement in SI cubic meters" "cubic meters", typeCubicMeters, "a volume measurement in SI cubic meters" "cubic centimetres", typeCubicCentimeter, "a volume measurement in SI cubic centimeters" "cubic centimeters", typeCubicCentimeter, "a volume measurement in SI cubic centimeters" "cubic feet", typeCubicFeet, "a volume measurement in Imperial cubic feet" "cubic inches", typeCubicInches, "a volume measurement in Imperial cubic inches" "cubic yards", typeCubicYards, "a distance measurement in Imperial cubic yards" "kilograms", typeKilograms, "a mass measurement in SI kilograms" "grams", typeGrams, "a mass measurement in SI meters" "ounces", typeOunces, "a weight measurement in SI meters" "pounds", typePounds, "a weight measurement in SI meters" "degrees Celsius", typeDegreesC, "a temperature measurement in SI degrees Celsius" "degrees Fahrenheit", typeDegreesF, "a temperature measurement in degrees Fahrenheit" For detailed information on Unit Coercions, see the document ³About Unit Coercions² in this SDK for details. To display these properly, we also add a global Get Data handler to handle requests on object specifiers and coerce them to values. This coercion converts an object specifier of the form meters 12 (for example) into an object of class meters with a value of 12 Folder Actions In Mac OS 8.5, a major new feature is the ability to attach a script to a Finder folder, and have handlers in that script trigger when specific Finder actions occur on that folder. There is no direct support in the AppleScript extension or language for Folder Actions; the principal work is done by a faceless background application and a Contextual Menu Manager plug-in in conjunction with some assistance from the Finder. Terminology for certain events is included in the AppleScript English Dialect¹s Œaeut¹ resource. Further information on Folder Actions can be found in the document ³Folder Actions Suites² in this SDK. New Terminology Flag Bits The flags word of the direct parameter, reply direct parameter, other parameter, and property declarations in the Œaete¹ template (in AEUserTermTypes.h and AEUserTermTypes.r) now have additional bits defined for applications to communicate additional information to editors, applications, and non-AppleScript languages. AppleScript at this point ignores these settings but may take advantage of this information in the future. kAEUTEnumsAreTypes = 11, /* if the enumeration is a list of types, not constants */ kAEUTEnumListIsExclusive = 10, /* if the list of enumerations is a proper set */ kAEUTReplyIsReference = 9, /* if the reply is a reference, not a value */ kAEUTDirectParamIsReference = 9, /* if the direct parameter is a reference, not a value */ kAEUTParamIsReference = 9, /* if the parameter is a reference, not a value */ kAEUTPropertyIsReference = 9, /* if the property is a reference, not a value */ kAEUTNotDirectParamIsTarget = 8, /* if the direct parameter is not the target of the event */ kAEUTParamIsTarget = 8, /* if the parameter is the target of the event */ The kAEUTEnumsAreTypes bit works with the existing kAEUTEnumerated bit; if both bits are set, the code for this object is the code of an enumerator that contains type names, not constants. The object is defined to be an object of any of the types listed in the enumeration. If the list bit is set as well, the object is a list of objects of any of the types. The kAEUTEnumListIsExclusive bit allows application developers to define ³sets.² This works with the kAEUTEnumerated bit as well; if both are set, the object is defined to be a list of constants that does not contain the same constant twice. The kAEUTDirectParamIsReference, kAEUTParamIsReference, and kAEUTPropertyIsReference bits all declare that the object¹s value is an object specifier that refers to an object of the type indicated by the code and the other bits. The kAEUTNotDirectParamIsTarget and kAEUTParamIsTarget allow the application developer to denote some parameter other than the subject to which an event should be dispatched. New Error Values Several developers have requested additional error codes. These codes have been added to Errors.h: errAENotAnEnumMember = -10023, /* the given enumerator is not a member of the enumeration */ errAECantPutThatThere = -10024, /* the parameter cannot be contained by the given container */ errAEPropertiesClash = -10025, /* the setting of this property conflicts with the current settings of other properties */ These error codes are most useful as responses to the Set Data, Make, or Duplicate events. New features in AppleScript 1.1.2 Mac OS 8.0 supports several new subfolders in the System Folder, including a top-level Scripting Additions folder. AppleScript 1.1.2 has been modified to look for scripting additions stored in this new folder. The ³path to² scripting addition has been extended to return the path name of the new folders. ________________________________ © 1998 Apple Computer. Inc. All rights reserved. Apple, the Apple logo, LaserWriter, MacTCP, Power Macintosh, Mac, and Macintosh are trademarks of Apple Computer, Inc., registered in the U.S. and other countries. PowerPC is a trademark of International Business Machines Corporation, used under license therefrom. All other product names are trademarks or registered trademarks of their respective holders. Mention of non-Apple products is for information purposes and constitutes neither an endorsement nor a recommendation. Apple assumes no responsibility with regard to the selection, performance, or use of these products. Updated January 22, 1999 v 1.0