Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Applescript: how to duplicate AND rename a file?

Applescript: how to duplicate AND rename a file?
Thread Tools
AJM
Junior Member
Join Date: May 2001
Status: Offline
Reply With Quote
Oct 25, 2001, 06:13 PM
 
Hi,
thanks to the people who answered my first question on renaming a file.
Unfortunately I still have a problem. Is it possible to duplicate an item and renaming it at the same time?
I would like to copy a file from one folder to another, but since the destination folder may have a file with the same name, I would like to have the copy have a different name. I can't rename before duplicating, because
then the original file would have been renamed too. And I can't obviously rename after duplicating, because either the file in the destination folder will have been replaced (using "with replacing"), or the script will stop with an error (using "without replacing" or if replacing has not been specified).
So far I make a copy of the file in the same folder (somehow this gets around the problem of having a file with the same name and not specifying replacing), rename this copy, and then move it. It is cumbersome though. Any other way?
By the way, this is in OS X.1

Thanks again,
AJM
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:53 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2