TOPIC
This article discusses the new Scripts folder.
DISCUSSION This folder is used to contain compiled scripts. The default installation of Mac OS 8.5 will create one folder within Scripts called "Folder Action Scripts", which contains some useful scripts to be used by the new Folder Actions facility. For much more information on using and writing Folder Action Scripts, see Folder Actions under AppleScript Help in the Mac OS Help facility . On the Mac OS 8 Install CD-ROM, there is a CD Extras folder. Within this folder is an AppleScript Extras folder, containing some additional AppleScript material. More Folder Action Scripts can be found here. In addition, Apple has provided a copy of a freeware extension called OSA Menu, by Leonard Rosenthal. OSA stands for Open Scripting Architecture. When installed, OSA Menu provides an iconic script menu on the right hand side of the menu bar that is always present in every application. This menu can be used to invoke AppleScripts appropriate for the currently running application. Two groupings of AppleScripts are shown in the OSA Menu, a set of Universal Scripts which are always displayed for every running application, and a second set of AppleScripts, which are applicable to the context of the current application. Menu items in the second grouping change as different applications become the front most or foreground application. OSA Menu creates its menu by looking for subfolders within the Scripts folder. These folders are named "Universal Scripts", "Finder Scripts", "Script Editor Scripts", etc. Any application can have its own set of associated scripts grouped in a subfolder of the Scripts folder, where the subfolder is named "<name of Application> Scripts". If no folder exists for the active application, OSA Menu displays a dimmed menu item that says "No Scripts", indicating that it found no folder with which to build menu items. OSA Menu will create a folder for an application by selecting the menu item: Open "<name of Application> Scripts" Folder. Some example scripts that can be used with OSA Menu are also provided in the AppleScript Extras folder. Users can write scripts or place acquired scripts into the subfolders of the Scripts folder to extend the menu environment with their own custom AppleScript command functions. Extending the Finder in this way is very easy to do. For example, perhaps you would like to be able to Empty Trash from any application, i.e. without switching to the Finder to empty the Trash and then back to the current application. Using the Script Editor, save the following one line AppleScript as a compiled script named "Empty Trash" and place it in the Universal Scripts subfolder.
From any application, one can then select the "Empty Trash" menu item from the OSA Menu. Scripting the Finder is one of the most powerful ways to enhance your environment and speed up your productivity. To do more than just record scripts, one needs to examine the dictionary of terms that the Finder understands and responds to. Again, using the Script Editor, save the following two line AppleScript as a compiled script named "Open Finder Dictionary" and place it in the Script Editor Scripts subfolder.
open alias Path_To_Finder |
Document Information | |
Product Area: | Mac OS System Software |
Category: | Mac OS 8.5 |
Sub Category: | General OS Topics |
Keywords: | kmos85 |
Copyright © 2000 Apple Computer, Inc. All rights reserved.