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

Place library item into a text frame

Community Beginner ,
Jan 30, 2017 Jan 30, 2017

Copy link to clipboard

Copied

Hello,

I'm quite new to InDesign Scripting. I would like to place text frames stored in a Library into another text frame. In InDesign, I would do the following steps:

- Place the text frame from the library

- Create a main text frame

- Ctrl+X the placed item

- Select the main text frame

- Ctrl+V

Having something like this:

Captura de pantalla 2017-01-30 a las 18.15.03.png

I'm currently able to create the text frame and also place the item from the library in the document...

Thanks

TOPICS
Scripting

Views

1.1K

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

Community Expert , Jan 30, 2017 Jan 30, 2017

Hi kelfas,

then your question is not about the library, but about how to anchor an object?

See here:

textFrame

Adobe InDesign CS6 (8.0) Object Model JS: TextFrame

textFrame.anchoredObjectSettings

Adobe InDesign CS6 (8.0) Object Model JS: AnchoredObjectSetting

textFrame.anchoredObjectSettings.insertAnchoredObject()

Adobe InDesign CS6 (8.0) Object Model JS: AnchoredObjectSetting

You are speaking of "library item".
That's an asset. And assets have method placeAsset() that also accepts text as argument:

Adobe InDesign CS6 (8.0) Object Model JS: Asset

...

Votes

Translate

Translate
Community Expert ,
Jan 30, 2017 Jan 30, 2017

Copy link to clipboard

Copied

Hi kelfas,

then your question is not about the library, but about how to anchor an object?

See here:

textFrame

Adobe InDesign CS6 (8.0) Object Model JS: TextFrame

textFrame.anchoredObjectSettings

Adobe InDesign CS6 (8.0) Object Model JS: AnchoredObjectSetting

textFrame.anchoredObjectSettings.insertAnchoredObject()

Adobe InDesign CS6 (8.0) Object Model JS: AnchoredObjectSetting

You are speaking of "library item".
That's an asset. And assets have method placeAsset() that also accepts text as argument:

Adobe InDesign CS6 (8.0) Object Model JS: Asset

Something like this should work, because insertionPoints belong to text:

var myTextFrame = app.documents[0].textFrames.add({geometricBounds : [0,0,100,100]})

app.libraries[0].assets[0].placeAsset(myTextFrame.insertionPoints[0]);

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
Community Expert ,
Jan 31, 2017 Jan 31, 2017

Copy link to clipboard

Copied

Hi kelfas,

or are you talking about CC Libraries and not an opened InDesign library file with suffix *.indl ?

And you want to place the asset in the loaded placegun to an insertion point of your text frame?

I would recommend this one:

Place the asset and use method insertAnchoredObject() of the placed pageItem's anchoredObjectSettings where you can define where to anchor (e.g. an insertionPoint of a text frame). How you anchor is defined with the anchoredObjectSettings of the placed pageItem. To see the details use the links I posted in my last reply.

For examples search this forum for the named method and preference.

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
Community Beginner ,
Jan 31, 2017 Jan 31, 2017

Copy link to clipboard

Copied

LATEST

Hello Uwe,


I referred to an InDesign library.

Thanks for your help!

Regards, César

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