Re: How do I use Finder & find documentation?
Re: How do I use Finder & find documentation?
- Subject: Re: How do I use Finder & find documentation?
- From: Graff <email@hidden>
- Date: Tue, 02 Dec 2003 23:42:12 -0500
Duplicate is there, it's in the "Standard Suite" part of the Finder
dictionary:
---------
duplicate: Duplicate one or more object(s)
duplicate reference -- the object(s) to duplicate
[to location reference] -- the new location for the
object(s)
[replacing boolean] -- Specifies whether or not to
replace items in the
destination that have the same name as items being
duplicated
[routing suppressed boolean] -- Specifies whether or not
to autoroute items
(default is false). Only applies when copying to the
system folder.
Result: reference -- to the duplicated object(s)
---------
To rename you use the set command:
set the name of theFileReference to "NewName.txt"
Putting it all together you might do something like:
---------
set theFile to (choose file with prompt "Pick the folder containing the
file to process:")
tell application "Finder"
duplicate theFile
set theNewFile to the result
set the name of theNewFile to "Blah.doc"
end tell
---------
You can find all of the properties of a Finder item (such as a file or
folder) in the Finder Dictionary under "Finder items" -> "Classes" ->
"item"
- Ken
On Dec 2, 2003, at 9:47 PM, Mark Dawson wrote:
I want to have users drop a folder on an applet and work off of
certain files in that folder: (a) I want to create a bundle (my
app-specific) with that file's name (xyz.ext -> xyz.premier).
(b) I want to then copy that file into the bundle ("xyz.ext" moves to
xyz.premier/Contents/xyz.ext)
I believe that I have the script working to the point that it finds
the file & extracts the non-extension part of the file name.
I think the easiest way to create a bundle is to duplicate a starting
bundle, then rename it.
However, I don't seem to see a "duplicate", rename, move, or copy
(well the copy says its not implemented) in the Finder's dictionary.
How do I duplicate, rename, and copy files and folders? Where would I
find documentation on this? I didn't see a lot of example
documentation
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.