Re: Newbie to Applescript
Re: Newbie to Applescript
- Subject: Re: Newbie to Applescript
- From: Mr Tea <email@hidden>
- Date: Wed, 14 Nov 2001 00:06:06 +0000
This from Chuck Lefebvre - dated 13/11/01 10.45 pm:
>
I would like to duplicate an individual file, and it's not stored on the
>
desktop. All of the example that I've seen, show you how to copy folder from
>
the desktop.
The most compact way of defining the location of a file or folder in
AppleScript is to use a path, with each item separated by a colon and the
whole thing wrapped in double quotes.
So if you have a file called "My File" in a folder called "My Folder" on a
disk called, er, "My Disk" and you want to copy it to a folder called "My
Other Folder" on the same disk, it would look something like this:
tell application "Finder" to duplicate file "My Disk:My Folder:My File" to
folder "My Disk:My Other Folder:"
That should all be on one line, and note that when the final item in the
path is a folder, its name is followed by a colon.
A less economical way to define a path is demonstrated when you use the
Script Editor to record actions in the Finder, with this format:
file "My File" of folder "My Folder" of disk "My Disk"...
HTH
Mr Tea
--
Brew of the day: Breakfast Blend