Copy link to clipboard
Copied
Hi all i have a script in InDesign that adds a cut line to my document, currently it runs on the active page then stops meaning i have to go to the next page manually and run the script again
i need a scrtipt or a code that will run a script move to the next page and run the script again how do i do that ?
Copy link to clipboard
Copied
You would have to loop thru the pages within the script. Can you post the code?
Copy link to clipboard
Copied
You can do something like this:
var inddFolder = Folder.selectDialog("Select Folders with .indd Files");
if (inddFolder == null) {
alert("There was no Folder Selected");
exit();
}
IDfileList = inddFolder.getFiles("*.indd");
for (var i = 0; i < IDfileList.length; i++) {
var myFile = IDfileList[i];
app.open(myFile);
}
while (app.documents.length > 0) {
//Post Your code here
}
Copy link to clipboard
Copied
Hi @schlindibus, I think @James22860505sgaq wants to run the cut line function on each page of the active document, not on different ID docs.
Copy link to clipboard
Copied
@rob day hmm looks like your're right 😕 Wanted to answer a question too for once haha 🙂
Is there a way to delete Answers?
Copy link to clipboard
Copied
You can only edit answers, but it’s not a problem I misread posts all the time
Copy link to clipboard
Copied
No no, this is also useful, i didn't even think of something like this
Copy link to clipboard
Copied
Ok. For pages within the active document it would be:
var p = app.documents[0].pages
for (var i = 0; i < p.length; i++){
$.writeln("add cut mark to this page: " + p[i].documentOffset)
//Add Code
};
Copy link to clipboard
Copied
Just wanted to add... sometimes it's good to add the cut-line to a layer on a master page. I don't know in your case but wanted to mention.
- Mark
Copy link to clipboard
Copied
I think this should work for you:
var myDoc = app.documents[0];
for(var i = 0; i < myDoc.pages.length; i++){
myDoc.pages[i].select();
app.doScript(File("Your script file path goes here"))
}
Best
Sunil