• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Renaming a file...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Packages
  • Next by Date: Re: osascript - path to me
  • Previous by thread: Re: Renaming a file...
  • Next by thread: Hello, I'm new here (now there's a classic)
  • Index(es):
    • Date
    • Thread