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

How can I set the first line indent is 0, according to the boxed text

Advocate ,
Sep 18, 2014 Sep 18, 2014

Copy link to clipboard

Copied

How can I set the first line indent is 0,according to the boxed text selected_text_to_inlineobj.jsx


https://gist.github.com/milligramme/9368861@

TOPICS
Scripting

Views

423

Translate

Translate

Report

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

correct answers 1 Correct answer

Enthusiast , Sep 19, 2014 Sep 19, 2014

Try this,

function boooxed (object_style_name) {

  if (app.selection.length !== 1) return

  var doc = app.documents[0];

  var sel = doc.selection[0];

  if ('baseline' in sel) {

    var bx = sel.insertionPoints[0].textFrames.add();

    bx.appliedObjectStyle = doc.objectStyles.item(object_style_name);

    bx.geometricBounds = [0,0,5,30];

    sel.duplicate(LocationOptions.AT_END, bx.parentStory);

    bx.insertionPoints[0].firstLineIndent=0;

    bx.fit(FitOptions.FRAME_TO_CONTENT);

    if (sel.conte

...

Votes

Translate

Translate
Enthusiast ,
Sep 19, 2014 Sep 19, 2014

Copy link to clipboard

Copied

Try this,

function boooxed (object_style_name) {

  if (app.selection.length !== 1) return

  var doc = app.documents[0];

  var sel = doc.selection[0];

  if ('baseline' in sel) {

    var bx = sel.insertionPoints[0].textFrames.add();

    bx.appliedObjectStyle = doc.objectStyles.item(object_style_name);

    bx.geometricBounds = [0,0,5,30];

    sel.duplicate(LocationOptions.AT_END, bx.parentStory);

    bx.insertionPoints[0].firstLineIndent=0;

    bx.fit(FitOptions.FRAME_TO_CONTENT);

    if (sel.contents.length) sel.remove();

  }

};

var object_style_name = "AAA"; //set anchored object settings, textframe preferences, and more

boooxed(object_style_name);

Vandy

Votes

Translate

Translate

Report

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
Advocate ,
Sep 20, 2014 Sep 20, 2014

Copy link to clipboard

Copied

Vandy, Thank you,very much~~ Again requests: If you can Let the text of box behind automatic Follow,but not blank

Votes

Translate

Translate

Report

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
Participant ,
Sep 20, 2014 Sep 20, 2014

Copy link to clipboard

Copied

LATEST

Is it possible to this function no objectstyle

Votes

Translate

Translate

Report

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