Apple AppleScript Finder Guide User Manual Page 19

  • Download
  • Add to my manuals
  • Print
  • Page
    / 168
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 18
CHAPTER 1
Introduction to Finder Scripting
Recording Actions in the Finder 7
window, turn on recording, choose the settings you want for each window
from the View menu, and turn off recording. Any significant changes you make
to the windows’ views will be recorded; however, if some of the View settings
for some of the windows are already set the way you want them, the Finder
won’t record the action because nothing changes as a result.
A more reliable approach is to add lines to the recorded script that set the View
settings. To do so, you must know how to tell the Finder to set the view of
a window.
The easiest way to learn how to describe an action in the Finder is to try
recording the action in a sample script. To learn how the Finder sets a
window’s view, follow these steps:
1. Open a new script window in the Script Editor by choosing New Script
from the File menu.
2. Click the Record button.
3. Activate the Finder by clicking on the desktop or choosing Finder from
the Applications menu.
4. Change the Views setting for one of the Finders windows.
5. Activate the Script Editor again and click the Stop button.
The recorded script looks something like this:
tell application "Finder"
activate
set view of window of folder "Financial" of startup disk to name
end tell
The third line of the recorded script sets the View property of the window for
the folder Financial to name. You can now use this line as a template for setting
the views of folder windows in a script. For example, to modify Listing 1-1 so
that the windows will always open in specific views, you could add these lines
just before the last line (that is, before end tell):
set view of window of startup disk to icon
set view of window of folder "Financial" of startup disk to name
set view of window of folder "Letters" of startup disk to size
Page view 18
1 ... 18 19 20 ... 168

Comments to this Manuals

No comments