Re: Renaming a file...
Re: Renaming a file...
- Subject: Re: Renaming a file...
- From: Lachlan Deck <email@hidden>
- Date: Sat, 18 May 2002 11:30:49 +1000
Hi there,
From: Monsoft <email@hidden>
Hi,
Beginning to evaluate Applescript with MacOS X 10.1.4:
I have to duplicate a file in another folder and change his name.
Simple.
tell application "Finder"
set myDuplicateFile to duplicate file myFile to folder myFolder
-- work fine
set the name of the file myDuplicateFile to myNewName
-- I'm enable to rename the file!
end tell
Got a -10001 error "a descriptor type mismatch occured".
property myFile : "TESTF:one.txt"
property myFolder : "TEST2"
property myNewName : "Hi.txt"
tell application "Finder"
set myDuplicateFile to ,
duplicate file myFile to folder myFolder ,
with replacing
set the name of myDuplicateFile to myNewName
end tell
I think the problem was that myDuplicateFile already points to a file -
so what you are saying is kind of like:
set the name of the file the file to myNewName
Instead,
set the name of the file to myNewName
So here we need to replace "the file" with "myDuplicateFile"...
with regards,
--
Lachlan Deck
email@hidden
_______________________________________________
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.