duplicate folder & contents, rename folder, pre-pend folder name to contents <p>Im hoping someone could help in building a small applescript. So far i havent found a solution that does exactly what i need.</p> <p>I have single folder with multiple files inside it. What i wish to do is to Duplicate that folder(with its contents) and have a prompt come up to input a new name for that folder. I also wish to Pre-pend the new name of that folder to all of the files inside it. Saving the folder(and contents) to a set location. (/Users/David/Custom)</p> <p><strong>Eg. Original structure;</strong> Folder name: "MainTemplate" Folder contents: "about.txt", "photo.jpg", "info.doc", etc. </p> <p><strong>Post-duplication;</strong> Folder name: "John The Dog" Folder contents: "John The Dog-about.txt", "John The Dog-photo.jpg", "John The Dog-info.doc", etc.</p> <h2>Thank you for your time.</h2> <p>NEW</p> <p>Ok, i've been working at this for 5+ hours. Re-naming the files is what i cant manage to figure out. Could someone please help me with this part? Also, maybe the script could be improved? Thanks!</p> <pre><code>on run {input, parameters} tell application "Finder" set theFolder to folder "OS X:Users:David:Desktop:SCRIPT:script-copy" set targetFolder to folder "OS X:Users:David:Desktop:SCRIPT:script-copy-finished" display dialog "Which structure do you wish to duplicate?" buttons {"Structure-MAIN", "Structure-OTHER"} set chosenStructure to button returned of result if contents of chosenStructure is equal to "Structure-MAIN" then set chosenStructure to "OS X:Users:David:Desktop:SCRIPT:script-copy:-MAIN" else set chosenStructure to "OS X:Users:David:Desktop:SCRIPT:script-copy:-OTHER" end if display dialog "Specify a new folder name:" default answer "John The Dog" set newName to (text returned of result) set createNewStructure to make new folder at targetFolder with properties {name:newName} duplicate every file of entire contents of folder chosenStructure to createNewStructure set the_folder to name of folder chosenStructure repeat with this_file in (get files of entire contents of folder chosenStructure) set the_start to offset of "_" in ((name of this_file) as string) set the_stop to count (name of this_file as string) set name of this_file to (the_folder &amp; (items the_start thru the_stop of (name of this_file as string))) end repeat end tell return input end run </code></pre>