Copy link to clipboard
Copied
i want Script for create border for text frame .
pleas help me .
Copy link to clipboard
Copied
Moving to InDesign Scripting forum
Copy link to clipboard
Copied
Indiscripts has a free script that you can download for this purpose:
Indiscripts :: PageBorder | Show your Clients the Limits!
Copy link to clipboard
Copied
You did not mention if you want an ExtendScript or AppleScript. Here's both:
ExtendScript:
var lineWt = "4 pt";
var colorChoice = "Black";
var docRef = app.documents[0];
var selList = app.selection;
var borderProps = {
fillColor: 'None',
strokeColor: docRef.swatches.itemByName(colorChoice),
strokeTint: 100,
strokeWeight: lineWt,
strokeAlignment: 1936998729, //center alignment
strokeType:'Solid'
};
//is there a rectangle selected, if so set its properties to property list borderProps
var selList = app.selection;
if (selList.length > 0 && selList[0].constructor.Name = "textFrame"){
selList[0].properties = borderProps;
}
AppleScript:
set linewt to "4 pt"
set colorChoice to "Black"
tell application "Adobe InDesign CC 2018"
set docRef to document 1
set theSwatch to swatch colorChoice of docRef
set borderProps to {stroke color:theSwatch, fill color:"None", stroke tint:100, stroke weight:linewt, stroke alignment:center alignment, stroke type:"Solid"}
set selList to selection
if selList is not {} then
set selItem to item 1 of selList
if class of selItem is text frame then
set properties of selItem to borderProps
end if
end if
end tell