TOPIC
AppleScripts that worked previous to Mac OS 8.5 do not work correctly any more. What is wrong?
DISCUSSION AppleScript 1.3 in Mac OS 8.5 was planned with the intention of upward compatibility for all existing scripts. There could be some cases where previously working scripts are broken. The most likely way a script might break is, if the dictionary for application being scripted was changed and has new terminology for properties and actions. With Mac OS 8.5, the Finder dictionary was reorganized to group properties and actions in a way designed to make things easier to find, read and understand. This change should not break existing scripts by itself. The Finder did revise some properties. Older scripts may have to be reworked to use the new terminology. The main area that has a change in properties from previous versions of the Finder is properties describing container window views. Finder 8.5 defines properties of "has custom view settings", "spatial view arrangement", and "button view arrangement" for window views. Finder 8.0/8.1 defines properties of "keep arranged" and "keep arranged by" for window views. If you are a script author and you would like to maintain one AppleScript that works across any Mac OS version, here is a coding technique that will enable this. As the script author, you will need to identify those terminology differences, between new and old Finder, then code verbs for each set of terminology, under the control of an "if ... then ... else ... " statement, so that the right action verbs and properties get used in the right Finder context. tell application "Finder" to get the version set FinderVersion to the result as text if FinderVersion is less than "8.5" then -- terminology for older Finder else -- terminology for Finder 8.5 end if |
Document Information | |
Product Area: | Mac OS System Software |
Category: | Mac OS 8.5 |
Sub Category: | General OS Topics |
Copyright © 2000 Apple Computer, Inc. All rights reserved.