Re: Naming a duplicated file
Re: Naming a duplicated file
- Subject: Re: Naming a duplicated file
- From: Luther Fuller <email@hidden>
- Date: Fri, 25 Mar 2011 11:06:11 -0500
On Mar 25, 2011, at 10:51 AM, John Haley wrote: That didn't seem to help...I am still getting the inconsistent results. It works for two or three times and then won't work for 3 or 4 times. The work and not work is the most annoying part!
I didn't think to mention that this is on a shared volume and not the local disk, not sure if that makes a difference. Also, I din't mention my particulars: most of us are on X.6.6 or X.6.7.
FWIW, which may be nothing, try this handler which avoids using 'duplicate'.
on copyFile(fileAlias, targetAlias, newFileName) -- fileAlias is an alias to the source file, targetAlias is an alias to the destination folder and newFileName is a string set sourcePath to (quoted form of POSIX path of fileAlias) set targetPath to (quoted form of (POSIX path of ((targetAlias as text) & newFileName))) try do shell script "cp -np " & sourcePath & space & targetPath return ((targetAlias as text) & newFileName) as alias end try return {} end copyFile --------------------------------------------------------------------
This handler does not preserve comments, however.
|
_______________________________________________
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