Cloning a folder?

J. Landman Gay jacque at hyperactivesw.com
Thu Sep 23 13:56:09 EDT 2010


On 9/23/10 8:46 AM, David Bovill wrote:
> It seems that revCopyFolder does not return a value for the new folder it
> creates - this is important when the destination folder already exists -
> because it still creates a folder but with a new folder name that at least
> on the Mac adds an integer value to the end of the name "ie ./folder 2"
>
> Is there an easy way to script cloning a folder within the same enclosing
> folder but giving it a new name? I want this to work cross platform. Any
> help with the following general purpose handler?
>
> command rev_CopyAndRename originalFolder, newFolder
>>     -- work in progress
>>     set the itemdelimiter to "/"
>>     put newFolder into enclosingFolder
>>     delete item -1 of enclosingFolder
>>     revCopyFolder originalFolder, enclosingFolder
>>     -- put it / the result into copiedFolder
>>     rename folder copiedFolder to newFolder
>> end rev_CopyAndRename

I think I'd name the new folder something arbitrary, like "temp", and 
after the copy is done, use the "rename folder" command to set the 
permanent name of the folder.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list