Apple AppleScript Finder Guide User Manual Page 31

  • Download
  • Add to my manuals
  • Print
  • Page
    / 168
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 30
CHAPTER 2
Finder Objects
The Finder Application Object 19
To obtain a standard reference to an element of the Finder while you’re writing
a script, follow these steps:
1. Select the object.
2. Choose Copy from the Edit menu.
3. Activate the Script Editor application.
4. Click at the point in your script where you want to paste the reference.
5. Choose Paste Reference from the Edit menu.
Windows are also elements of the Finder application. You can address a Tell
statement to a Finder window anywhere in a script:
tell front window of application "Finder"
close
end tell
Because window is a standard AppleScript term, AppleScript can interpret this
script correctly. However, when it compiles a script, AppleScript doesn’t look
up the Finder’s terminology definitions until after it has compiled the first line
of the first Tell statement that addresses the Finder. Therefore, a script that
consists of a Tell statement addressed to any other Finder object won’t compile:
tell startup disk of application "Finder"
open
end tell
To address a Tell statement to a Finder object other than a window, enclose it
within another Tell Statement, like this:
tell application "Finder"
tell startup disk
open
end tell
end tell
Page view 30
1 ... 30 31 32 ... 168

Comments to this Manuals

No comments