質問
Move Images to the Bottom of the Page
- April 20, 2023
- 返信数 2.
- 401 ビュー
Hi,
I need to remove the images which is present in the top of each pages after placing the images to the bottom of the page which is shown in the "Output Document.indd". But while executing this script I'm able to place the frame in the bottom of the page at the sametime I cannot able to remove the images at the top of the page. The script I have used is given below. Please guide me on this..
var doc = app.activeDocument;
var frameX = 60;
var frameY =640;
var frameWidth = 50;
var frameHeight = 50;
for (var i = 0; i < doc.pages.length; i++) {
var page = doc.pages[i];
var imageNamesArray = [];
imageNamesArray.splice(0, imageNamesArray.length);
for (var m = 0; m < page.allPageItems.length; m++) {
var item = page.allPageItems[m];
if (item instanceof Image) {
var imageName = item.itemLink.name;
if (imageName.length > 0) {
imageNamesArray.push(imageName);
}
}
}
for (var q = 0; q < imageNamesArray.length; q++) {
var imagePath = FolderPath() + "/" + imageNamesArray[q];
var currentFrameX = frameX + q * (frameWidth + 10);
imageNamesArray[q].move(undefined, [frameY, currentFrameX, frameY + frameHeight, currentFrameX + frameWidth]);
}
}
