Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

how script border to text frame.

Community Beginner ,
Apr 10, 2018 Apr 10, 2018

i want Script for create border for text frame .
pleas help me .

TOPICS
Scripting
1.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 10, 2018 Apr 10, 2018

Moving to InDesign Scripting forum

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 15, 2018 Apr 15, 2018

Indiscripts has a free script that you can download for this purpose:

Indiscripts :: PageBorder | Show your Clients the Limits!

If the answer wasn't in my post, perhaps it might be on my blog at colecandoo!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 15, 2018 Apr 15, 2018
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines