beautypg.com

Apple AppleScript Finder Guide User Manual

Page 135

background image

C H A P T E R 3

Finder Commands

Command Definitions

123

If you save this script as an application and drag a folder onto the application’s

icon, the script searches the entire startup disk for any items whose names

include the name of the folder and creates alias files in that folder for all

matching items:

on open x

tell application "Finder"

repeat with i in x

set n to name of i
open i
make alias file to every item of entire contents ¬

of startup disk whose name contains n at i

end repeat

end tell

end open

This script may take a minute or more to run if the startup disk contains a large

number of items.

NOTES

When you use the Make command to create a new file, you can’t use the term
new

before the term file:

tell application "Finder"

make file at startup disk with properties ¬

{name: "My File"}

end tell

For all other object classes, the term new is optional.