• 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 cut rectangle into the textFrame script?

Explorer ,
Apr 10, 2017 Apr 10, 2017

Copy link to clipboard

Copied

How can i cut rectangle into the textFrame script? Please help me

TOPICS
Scripting

Views

725

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
Community Expert ,
Apr 10, 2017 Apr 10, 2017

Copy link to clipboard

Copied

This needs more words. And perhaps a few images: do it by hand, and show the difference before/after.

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
Explorer ,
Apr 10, 2017 Apr 10, 2017

Copy link to clipboard

Copied

Before:

Öncesi.png

After:

sonrası.png

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
Engaged ,
Apr 10, 2017 Apr 10, 2017

Copy link to clipboard

Copied

Hi,

Try this code!!!

    

var myDoc = app.activeDocument;

var myTextFrame = myDoc.textFrames.everyItem().getElements();

var ins=app.activeDocument.textFrames.item(0).insertionPoints.item(2);

var Rec = ins.rectangles.add();

Rec.geometricBounds = ["4p","3p", "10p", "10p"]

Thanks,

Prabu G

Thanks
AP

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
New Here ,
Apr 10, 2017 Apr 10, 2017

Copy link to clipboard

Copied

I understood what he is talking about. He wants to cut unanchored text frame or unanchored object into the text frame.

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
Community Expert ,
Apr 10, 2017 Apr 10, 2017

Copy link to clipboard

Copied

LATEST

Hi Ahmet,

if your version of InDesign is CS5.5 or above you can use the method insertAnchoredObject() of the anchoredObjectSettings of your rectangle. The method requires two arguments: storyOffset and anchoredPosition . storyOffset is an insertionPoint, one in your textFrame you like the rectangle to be anchored with, anchoredPosition is the kind of anchoring you like to do: inline, above line or anchored expressed with enumerators.

Have two objects on page 1 of your document.

A rectangle and a text frame.

var rectangle = app.documents[0].rectangles[0];

var textFrame = app.documents[0].textFrames[0];

// Anchor the rectangle inline  at the first insertion point of the text frame:

rectangle.anchoredObjectSettings.insertAnchoredObject( textFrame.insertionPoints[0] , AnchorPosition.INLINE_POSITION );

See also DOM documentation here:

Indesign JavaScript Help

Adobe InDesign CS6 (8.0) Object Model JS: AnchoredObjectSetting

Regards,
Uwe

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