• 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: Naming a duplicated file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Naming a duplicated file


  • Subject: Re: Naming a duplicated file
  • From: Luther Fuller <email@hidden>
  • Date: Fri, 25 Mar 2011 17:14:10 -0500

On Mar 24, 2011, at 6:15 PM, John Haley wrote:
I have been tinkering with this all afternoon and finally give up.  I want to duplicate a file and change its name.

When I submitted my copyFile handler I could not remember with certainty the problem that I had encountered with using 'duplicate' that prompted writing that handler. It has been awhile. This afternoon I did a little experiment. What happens is that if you have an alias to a file and use that alias to change the name of the file, then the alias becomes corrupted.

Here's the experiment ...

set newName to "New_Folder_Name"
tell application "Finder"
set itemAlias to (folder "untitled folder 2" of (path to desktop)) as alias
set name of itemAlias to newName
end tell
try
(itemAlias as text) as alias
on error errText number errNr
"Error = " & errNr & ", " & errText
log the result -- Error = -43, File /Users/lutherfuller/Desktop/untitled folder 2 wasn’t found.
end try

There seem to be two bugs, here:

1. The line  set name of itemAlias to newName  should change the alias to comply with the new name.
    But it doesn't.

2. The Finder's 'duplicate' command should allow a properties list for the new file.
    It would be very useful to be able to write something like ...
duplicate itemAlias to folderAlias with properties {name:newName}
    But you can't do that.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Naming a duplicated file (From: John Haley <email@hidden>)

  • Prev by Date: Re: Naming a duplicated file
  • Next by Date: Re: Naming a duplicated file
  • Previous by thread: Re: Naming a duplicated file
  • Next by thread: Zippin'
  • Index(es):
    • Date
    • Thread