beautypg.com

Apple AppleScript Finder Guide User Manual

Page 126

background image

C H A P T E R 3

Finder Commands

114

Command Definitions

EXAMPLE

tell application "Finder"

delete file "OldFile" of startup disk

end tell

Duplicate

3

A Duplicate command is a request to make a copy of an object or objects and

insert the new copy either at a specified location or in the same container as the

object that was copied. The Finder version of the Duplicate command is similar

to the standard version described in the AppleScript Language Guide, except that

the Finder’s Duplicate command allows you to specify whether or not to

replace items of the same name in the destination container.

SYNTAX

duplicate

referenceToObject [ to referenceToLocation ] ¬

[ replacing ( conflicts | existing items ) ]

PARAMETERS

referenceToObject

A reference to the object or objects to be duplicated.

Class:

Reference

referenceToLocation

A reference to the location for the duplicated object or objects.

Class:

Reference

Default value:

If you don’t specify a new location, the object is

inserted in the same container as the original object and the

word “copy” is appended to the new object’s name.

RESULT

A reference to the new object or a list of references.