How can i merge these scripts?
How can i merge these scripts? what i'm trying to do is make a layer named (dieline) and a Text frame named (Dieline) i want the text frame to be but in the Dieline layer. i can do each one separate minus the moving from one layer to another. but I would like it if i could have it all in one script.
function addDLf(doc, layer, name){
var mynBlendingSettings = { blendMode : BlendMode.OVERLAY };
var mynTransparencySettings = { blendingSettings : mynBlendingSettings };
var tfn = doc.textFrames.itemByName(name);
if(tfn && tfn.isValid) {
tfn.exit ();
}
var orignUnit = app.scriptPreferences.measurementUnit;
app.scriptPreferences.measurementUnit = MeasurementUnits.INCHES;
tfn = doc.textFrames.add(layer, LocationOptions.UNKNOWN, {name: name, fillColor :"Dieline", fillTint: 40, transparencySettings : mynTransparencySettings});
tfn.geometricBounds = [doc.pages[0].bounds[2] + 0,0, doc.pages[0].bounds[2] + 0,0]
app.scriptPreferences.measurementUnit = orignUnit;
return tfn;
}
function doDLm(event){
var doc = event.target;
if(!(doc && doc.constructor.name == "Document")) {
return;
}
var myLayern = addLayer(doc, "Dieline");
var tfn = addTextFramen(doc, myLayern, "Dieline");
}
var doc = app.documents[0];
var page = doc.pages[0];
page.textFrames.add
(
{
geometricBounds : page.bounds ,
fillColor : "None" ,
strokeColor : "Diecut" ,
strokeWeight : "1pt" ,
strokeAlignment : StrokeAlignment.CENTER_ALIGNMENT ,
overprintStroke : true,
topLeftCornerRadius : "3.175mm",
topLeftCornerOption : CornerOptions.ROUNDED_CORNER,
bottomLeftCornerRadius : "3.175mm",
bottomLeftCornerOption : CornerOptions.ROUNDED_CORNER,
topRightCornerRadius : "3.175mm",
topRightCornerOption : CornerOptions.ROUNDED_CORNER,
bottomRightCornerRadius : "3.175mm",
bottomRightCornerOption : CornerOptions.ROUNDED_CORNER,
}
);