beautypg.com

Apple AppleScript Finder Guide User Manual

Page 106

background image

C H A P T E R 2

Finder Objects

94

Object Class Definitions

position

Two integers that specify the position of the upper-left corner

of the user’s icon.

Class:

List of two integers (Point data type)

Modifiable?

Yes

ELEMENT CLASSES

None

COMMANDS HANDLED

Clean Up, Close, Count, Data Size, Exists, Get, Make, Open, Select, Sort, Update

DEFAULT VALUE CLASS RETURNED

A reference to a user or, if you use the plural form users, a list of references.

EXAMPLE

The script that follows displays a dialog box requesting the name of the new

user file to create, then opens the control panel Users & Groups, creates the

new user file, and sets the user’s name. Listing 1-3 on page 12 incorporates this

script into a longer script that also creates a drop folder for the new user.

tell application "Finder"

set response to display dialog ¬

"Name of new user:" default answer ""

set newUser to text returned of response
set cPanels to control panel "Users & Groups" of ¬

control panels folder

open cPanels
make user at cPanels with properties {name: newUser}

end tell