Apple AppleScript Finder Guide User Manual Page 148

  • Download
  • Add to my manuals
  • Print
  • Page
    / 168
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 147
CHAPTER 3
Finder Commands
136 Command Denitions
EXAMPLES
This script returns a list of references to the folders in the startup disk, sorted
by creation date:
tell application "Finder"
sort folders in startup disk by creation date
end tell
--result: {folder "Letters" of startup disk of
application "Finder", folder "Projects" of startup disk
of application "Finder", folder "Current Correspondence" of
startup disk of application "Finder"}
This script sorts files from several different folders by size.
tell application "Finder"
sort {files in startup disk, files in disk "Data"} ¬
by size
end tell
--result: {file "George" of startup disk of application
"Finder", file "Notes" of disk "Data" of application
"Finder", file "Expenses" of startup disk of application
"Finder"}
NOTES
The Sort command usually sorts in ascending order; for example, if you sort by
name, the resulting references are sorted alphabetically by name. When you
sort by creation date or modification date, the Sort command returns a list of
references sorted in descending order from the newest item to the oldest.
To sort the actual items that are displayed in a window, rather than a list of
references to those items, either set the View property of the window or, if the
items are displayed by icon or by small icon, use the Clean Up command as
described on page 104.
Page view 147
1 ... 147 148 149 ... 168

Comments to this Manuals

No comments