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

Script to automatically link page frames?

Contributor ,
Apr 13, 2022 Apr 13, 2022

After doing a data merge, I need all the text frames to link so they are all flowing together. Is there a script that will do that? possibly calling out a specific object style used for that text frame?

TOPICS
How to , Scripting
646
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

correct answers 1 Correct answer

Community Expert , Apr 13, 2022 Apr 13, 2022

Name the text frame on your template layers panel before running the merge, then try this on the merged document.  In this case, the text frame would be named "templateFrame".

var ps = app.activeDocumment.pages;
var ct, nt;
for (var i = 0; i < ps.length - 1; i++) {
    ct = ps[i].textFrames.itemByName("templateFrame");
    nt = ps[i+1].textFrames.itemByName("templateFrame");
    ct.nextTextFrame = nt;
}

 

 

Translate
Community Expert ,
Apr 13, 2022 Apr 13, 2022

This script may be what you need. 

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
Contributor ,
Apr 13, 2022 Apr 13, 2022

this one is merging multiple text frames on a page, my data merge exports out 100 pages with one frame per page and I need to link all the text frames across the document. this doesnt work for that

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 13, 2022 Apr 13, 2022

in that case, maybe the script in this thread will be of help. 

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
Contributor ,
Apr 13, 2022 Apr 13, 2022

i tried that one and it wasnt working. Thank you though ... which some more creative searching, I found this one and works! https://community.adobe.com/t5/indesign-discussions/data-merge-multiple-entries-in-single-text-box/t...

 

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 13, 2022 Apr 13, 2022

Name the text frame on your template layers panel before running the merge, then try this on the merged document.  In this case, the text frame would be named "templateFrame".

var ps = app.activeDocumment.pages;
var ct, nt;
for (var i = 0; i < ps.length - 1; i++) {
    ct = ps[i].textFrames.itemByName("templateFrame");
    nt = ps[i+1].textFrames.itemByName("templateFrame");
    ct.nextTextFrame = nt;
}

 

 

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
Contributor ,
Apr 13, 2022 Apr 13, 2022

thank you! being able to call out the specific frame will be immensly helpful!

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 13, 2022 Apr 13, 2022

Cool. To clarify, don't use quotes when naming the frame in your layers panel. 

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
Contributor ,
Apr 13, 2022 Apr 13, 2022
LATEST

yep, I'm slowly getting there with my scripting so I recognize the use of them in this script. thanks!

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