Build Step - Copy And Rename Folder

How can I create a build step that takes all sub-directories and copies a folder from one location to the app directory folder and rename the copied version?

Thanks

With the shell and many escaped characters. Here is an example that copies some files:

[code]

dim cmd as String
cmd = "mkdir " + CurrentBuildLocation + "/Extras"
dim theOutput as string = doShellCommand(cmd)

'prepare
dim CountSlashes as Integer = CountFields(ProjectShellPath, “/”)
dim ProjectName as string = NthField(ProjectShellPath, “/”, CountSlashes)
dim ProjectPath as String = Left(ProjectShellPath, Len(ProjectShellPath) - Len(ProjectName))

if theOutput <> "" then print theOutput
'copy Filemaker 12 file
cmd = "cp " + ProjectPath + "Extras/eMailViewerX.fmp12 " + CurrentBuildLocation + "/Extras"
theOutput = doShellCommand(cmd)
if theOutput <> "" then print theOutput
'copy uninstaller
cmd = "cp -R " + ProjectPath + "Extras/Uninstall\\ Mail\\ Archiver.app " + CurrentBuildLocation + "/Extras"
theOutput = doShellCommand(cmd)
if theOutput <> "" then print theOutput
    
'and copy to final build
CountSlashes = CountFields(CurrentBuildLocation, "/")
dim AppName as string = NthField(CurrentBuildLocation, "/", CountSlashes)
dim BuildPath as String = Left(CurrentBuildLocation, Len(CurrentBuildLocation) - Len(AppName))
    
cmd = "mkdir " + BuildPath + "final/Extras"
theOutput = doShellCommand(cmd)
if theOutput <> "" then print theOutput
cmd = "cp " + ProjectPath + "Extras/eMailViewerX.fmp12 " + BuildPath + "final/Extras"
theOutput = doShellCommand(cmd)
if theOutput <> "" then print theOutput
cmd = "cp -R " + ProjectPath + "Extras/Uninstall\\ Mail\\ Archiver.app " + BuildPath + "final/Extras"
theOutput = doShellCommand(cmd)
if theOutput <> "" then print theOutput[/code]

For your own scripts:

  1. Do the scripts in Terminal with absolute paths first
  2. Then convert to build script
  3. Replace absolute paths with relative paths and the build constants.

How would I write this in the terminal? I presume you mean Command Prompt for Windows users. So how would I do that?

Thanks

In Mac OS you can drag a file to Terminal and it inserts the path for you. AFAIK in Windows you have to type the path by hand.