beautypg.com

Apple AppleScript Finder Guide User Manual

Page 132

background image

C H A P T E R 3

Finder Commands

120

Command Definitions

RESULT

A reference or list of references to the requested objects or, in the case of

properties that consist of a value, a value of either the object’s default value

class or the class specified by the className parameter, or a list of values of that

class. If the Finder can’t return data in the value class specified by the className

parameter, it generates an error.
If the referenceToObject parameter specifies a single object only (such as name
of window 1

), the result is a single value or reference. If the referenceToObject

parameter refers to more than one object (such as items in startup disk),

the result is a list of values or references. If the specified object doesn’t exist, for

example, if the reference is folder "My Folder" in startup disk and

there is no folder of that name in the startup disk, the Finder generates an error.

EXAMPLES

This script returns the sizes, in bytes, of the folders at the top level of the

startup disk:

tell application "Finder"

get size of folders in startup disk

end tell

--result: {27636, 1438359, 1774813}

This script returns a list of references to the folders at the top level of the

startup disk:

tell application "Finder"

get folders in startup disk

end tell

--result: folder "Projects" of startup disk of
application "Finder", folder "Financial" of startup disk of
application "Finder", folder "Applications" of startup disk
of application "Finder"