Copy link to clipboard
Copied
Hello everyone
I'm working on an editorial project to create agendas. I am using data merge to create the pages with calendar data, however due to a project specialty the data merge creates the duplicate pages.
I need to create a script that I can automatically remove from two pages from a page number specified by me.
I tell scrip that two pages he starts deleting, he deletes these two, jumps two and deletes the next two and continues until the document is finished.
Can someone help me?
Hi,
first things first: create a backup of your document before you run this script.
Second: insert in line 3 the index number of the page from where it should start the deleting process. The index number is 1 less than the page number. For example: if you want to start from page number 5 the value of startPage should be 4.
...var doc = app.activeDocument;
var startPage = "insert start value";
var currentPage = startPage;
while (currentPage < doc.pages.length)
{
doc.pages[currentPage].remove();
i
Copy link to clipboard
Copied
Hi,
first things first: create a backup of your document before you run this script.
Second: insert in line 3 the index number of the page from where it should start the deleting process. The index number is 1 less than the page number. For example: if you want to start from page number 5 the value of startPage should be 4.
var doc = app.activeDocument;
var startPage = "insert start value";
var currentPage = startPage;
while (currentPage < doc.pages.length)
{
doc.pages[currentPage].remove();
if (currentPage <= doc.pages.length)
{
doc.pages[currentPage].remove();
} else {exit();}
currentPage = currentPage +2;
}
Copy link to clipboard
Copied
Thank you again. The script worked perfectly. My project is ready to be finalized and I owe a lot to you.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more