I want to copy and past contents of folder with ESTK
Hello,
to change template, I'm trying to use ESTK scripts.
I made scripts
I wish I can get tips for solving this problem.
Hello,
to change template, I'm trying to use ESTK scripts.
I made scripts
This requires "recursion" in order to work your way down the file/folder structure. Recursion is where a function calls itself. Here is an example that doesn't do any copying, but just writes the file and folder names from your source folder and subfolders to the FrameMaker Console. I will try to post a version that actually copies, but this will give you concept of touching each file and folder. You will have to edit the code and put in your own source and destination folders.
#target framemaker
var sourceFolder, destinationFolder;
sourceFolder = new Folder ("C:\\DATA-10\\Scripts\\ArtCampbell\\20240205-TitleCase");
destinationFolder = new Folder ("C:\\DATA-10\\Scripts\\ArtCampbell\\Copy");
processFolder (sourceFolder);
function processFolder (sourceFolder, destinationFolder) {
var files, count, i;
files = sourceFolder.getFiles ();
count = files.length;
for (i = 0; i < count; i += 1) {
if (files[i] instanceof Folder) {
Console ("folder: " + files[i].fsName);
// Recursive call to this function:
processFolder (files[i], destinationFolder);
}
else {
Console ("* " + files[i].fsName);
}
}
}
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.