Copy entire page with textframe at the end of pasted document
Hi, in this topic:
Copy whole page to another document when textFrame exist
We covered a lot, but there is one major problem with that script
Lets say:
"Tree" TextFrame is on page - 6
"Apple" TextFrame is on page - 11
"Mango "TextFrame is on page - 43
So after selecting Tree Apple Mango, pages are duplicated but in the copied document they are on the same pages... Can they be copied at the end of document no matter how many pages document has?. If copierd document doesnt have these pages, ERROR
var dialog = new Window("dialog");
dialog.text = "Dialog";
dialog.preferredSize.width = 54;
dialog.preferredSize.height = 53;
dialog.orientation = "column";
dialog.alignChildren = ["left","top"];
dialog.spacing = 14;
dialog.margins = 36;
var panel1 = dialog.add("panel");
panel1.text = "Select Text";
panel1.preferredSize.width = 134;
panel1.orientation = "column";
panel1.alignChildren = ["left","center"];
panel1.spacing = 10;
panel1.margins = 18;
panel1.alignment = ["left","top"];
var statictext1 = panel1.add("statictext");
statictext1.text = "Include Texts";
var checkbox1 = panel1.add("checkbox");
checkbox1.text = "Tree";
var checkbox2 = panel1.add("checkbox");
checkbox2.text = "Apple";
var checkbox3 = panel1.add("checkbox");
checkbox3.text = "Mango";
var group1 = dialog.add("group");
group1.orientation = "row";
group1.alignChildren = ["left","center"];
group1.spacing = 10;
group1.margins = 0;
var Ok = group1.add("button");
Ok.text = "Ok";
Ok.justify = "center";
var Cancel = group1.add("button");
Cancel.text = "Cancel";
Cancel.justify = "center";
//////
if(dialog.show() == 1){
var tmpArr = [];
for(var x = 0; x < panel1.children.length; x++){
if(panel1.children
.constructor.name.toLowerCase() == "checkbox"){ if(panel1.children
.value){ tmpArr.push(panel1.children
.text.toString()); }
}
}
if(tmpArr.length > 0){
/// here
process(tmpArr);
}
else{
alert ("No text included", "", true)
}
}
PS: Thanks Sunil Yadav for previous work