• 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: Finder file rename confusion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finder file rename confusion


  • Subject: Re: Finder file rename confusion
  • From: Dick Huskey <email@hidden>
  • Date: Tue, 22 Feb 2005 15:17:56 -0500

Thanks for the reply.

If there is an existing file AS will report:

tell application "Finder"
set name of file "zx.0.txt" of folder "zxdir:zxdir" of home to "zx.1.txt"
"Finder got an error: The operation could not be completed because there is already an item with that name."


so a previously existing file is not the problem.

Again,
Thanks for the interest & reply.

On Feb 22, 2005, at 13:46, yvan-koenig wrote:


Le 22 févr. 2005 , à 9:40, Dick Huskey a écrit :

Howdy,

My head must be dead.

I just want to rename a file (zx.0.txt)) that exists in a directory ~/zxdir or ~zxdir/zxdir to a new name (zx.1.txt)

tell application "Finder"
-- assumes:
-- 1) zx.0.txt exists in the folder ~/zxdir
set oldFileName to "zx.0.txt"
set newFileName to "zx.1.txt"
set the name of file oldFileName of folder "zxdir" of home to newFileName
end tell -- finder


The event log returns:
set name of file "zx.0.txt" of folder "zxdir" of home to "zx.1.txt"
"Finder got an error: Can't set name of file \"zx.0.txt\" of folder \"zxdir\" of home to \"zx.1.txt\"."


This works fine if the folder is home or desktop but not something within those same directories.
why?
How do you figure this out?



Isn't it simply because there is already a file named "zx.1.txt" in the folder?


Yvan KOENIG



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Finder file rename confusion (From: Dick Huskey <email@hidden>)
 >Re: Finder file rename confusion (From: yvan-koenig <email@hidden>)

  • Prev by Date: Re: RegExps in AS
  • Next by Date: Re: "Couldn't save document"
  • Previous by thread: Re: Finder file rename confusion
  • Next by thread: Getting missing font info in XPress
  • Index(es):
    • Date
    • Thread