Resize and move a library element of type "compound path"
Good afternoon! I am new to writing scripts for InDesign, please help with solving this problem.
There is a script that puts the bones in a specific place on the spread and color, and also inserts one logo 2 times from the Open Library.
I had a problem indicating the location of the logo. It should be located on each stamp 3 mm higher from the bottom of the stamp. And also I can’t change the height size by 8.761 mm, respectively change the width (by default, the logotope is inserted with dimensions 28 * 33 mm). The default logo layer is called a compound path.
#target indesign
var myDoc = app.activeDocument;
var myColor = myDoc.colors.add({name:"LogoColor", model:ColorModel.process, colorValue:[100, 80, 0, 0]});
myDoc.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;
var myPages = myDoc.pages;
var bleedTop = myDoc.documentPreferences.properties.documentBleedTopOffset ;
var myLib = app.libraries.item("Logo.indl");
var myAsst = myLib.assets.item("logo1");
var myLayer = myDoc.layers.add ({name: "Logo", layerColor: UIColors.LIGHT_BLUE });
var logoC = myPages[0].textFrames.add({name: "Logo_cor", layer : "Logo" , LocationOptions : LocationOptions.AT_BEGINNING, reference: Page});
var otsL2 = myDoc.pages[0].marginPreferences.left;
var otsR2= myDoc.pages[0].marginPreferences.right;
var pageHeight2 = myDoc.pages[0].bounds[3] - myDoc.pages[0].bounds[1];
with (logoC) {
fillColor = "LogoColor";
strokeColor = "None";
contentType = ContentType.unassigned;
geometricBounds = [ - bleedTop , otsL2, 27, pageHeight2-otsR2]
}
var myArr1 = myAsst.placeAsset(myDoc);
var logoO = myPages[1].textFrames.add({name: "Logo_obl", layer : "Logo" , LocationOptions : LocationOptions.AT_BEGINNING, reference: Page});
var otsL3 = myDoc.pages[1].marginPreferences.left;
with (logoO) {
fillColor ="LogoColor";
strokeColor = "None";
contentType = ContentType.unassigned;
geometricBounds = [ - bleedTop , otsL3 , 27, otsL3+11.5]
}
var myArr2 = myAsst.placeAsset(myDoc);Thank you for any advice!