Cloning a folder?
david at vaudevillecourt.tv
Thu Sep 23 09:46:16 EDT 2010
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
More information about the Use-livecode