This chapter discusses one of the most powerful aspects of UserTalk: its ability to manipulate files, folders, and other system-level objects on the Macintosh. The next chapter continues the discussion, showing how to use these features in scripts that live on the desktop instead of inside Frontier.
UserTalk includes a full complement of verbs to deal with the Macintosh Finder and System. These verbs can be divided into the following categories:We'll look briefly at each of these verb types in the following sections. Details on each verb can be found in DocServer.
- file verbs
- Finder verbs
- launch verbs
- speaker verbs
- system verbs
There are 88 file verbs in UserTalk. They enable you to:These are just some of the dozens of functions you can perform on Macintosh files, folders, and volumes with the file verbs.
- copy, delete, move, rename, and create files and folders
- find out if files and folders exist, when and by what application they were created, what version they are, when they were last modified, and how big they are
- change file creator and type
- compare two files
- count the lines in a file
- find text in a file's contents
- display standard Macintosh file dialog boxes
- find out how many bytes, files, or folders are in a folder
- read and write text files
- find out how many volumes are on-line, how big they are, how much information is stored on them, how much free space they have, and whether they are ejectable
- break a full file path name into file, folder, and volume information
- lock and unlock files and folders and find out if they are locked
- create alias files, find out if a file is an alias, and follow aliases to their parents
- copy a file to the System Folder
The Finder is an application that comes with your Macintosh. (You'd be surprised how many people don't know that!) Finder verbs in UserTalk can:All of these features work in System 7 or greater, the "Scriptable Finder" is not required. Frontier supports many additional features if you have the Scriptable Finder (bundled with System 7.5, available for earlier releases). Verbs that work with the original System 7 Finder are in the "FinderClassic" table. The new Finder table contains the original verbs plus about 20 new ones.
- change the way files and folders are viewed
- open, close, grow, zoom, and move windows in the Finder
- duplicate, move, drag, open, print, put away, and make aliases of files
- restart or shut down the system
- move Finder to the front of your application
- show the Clipboard
With the launch verbs in UserTalk, you can launch any object that appears in the Apple menu, any Control Panel, any application, or any code resource (such as an FKEY).
You can set up sound parameters and activate the system's speaker with the UserTalk speaker verbs.
System-level verbs deal for the most part with applications that are running. You can use UserTalk verbs to:Contents Page | Next Section -- Example: Alias MakerMany of these features are also available in the verbs that are specific to an application, e.g. uBASE.bringToFront instead of the more generic sys.bringAppToFront.
- find out if an application is running
- find out how many applications are now running
- retrieve the ID of any running application
- find out which application is frontmost
- move a particular application to the front