Script to add a linked textframe to a selected textframe

New Here ,
Dec 19, 2020

Copy link to clipboard

Copied

In short: Is there a way to add a linked textframe with predefined geometricBounds to a selected textframe?

 

For a newspaper, I have to perform these repetitive tasks:

  1. Create textframe and paste the newsarticle in plain text.
  2. Add the 'then next style' paragraph styles (for location, articletitle, leadtext, article and signature).
  3. Divide the textframe into parts (location has to be it's own textframe, the title needs his own textframe, the leadtext also, etc....)

 

I've already set up a script that cleans up the text and prepares it for further use.

I would like the script to add the needed linked textframes.

 

Many thanks ahead

Adobe Community Professional
Correct answer by brianp311 | Adobe Community Professional

Yes, there's a way.

 

textFrames.add({geometricBounds: [y1,x1,y2,x2]})

 

Adds and returns a new text frame at the defined coordinates. 

 

textFrame.previousTextFrame = oldTF

 

makes that new text frame connected to the previous. 

TOPICS
Scripting

Views

77

Likes

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

Script to add a linked textframe to a selected textframe

New Here ,
Dec 19, 2020

Copy link to clipboard

Copied

In short: Is there a way to add a linked textframe with predefined geometricBounds to a selected textframe?

 

For a newspaper, I have to perform these repetitive tasks:

  1. Create textframe and paste the newsarticle in plain text.
  2. Add the 'then next style' paragraph styles (for location, articletitle, leadtext, article and signature).
  3. Divide the textframe into parts (location has to be it's own textframe, the title needs his own textframe, the leadtext also, etc....)

 

I've already set up a script that cleans up the text and prepares it for further use.

I would like the script to add the needed linked textframes.

 

Many thanks ahead

Adobe Community Professional
Correct answer by brianp311 | Adobe Community Professional

Yes, there's a way.

 

textFrames.add({geometricBounds: [y1,x1,y2,x2]})

 

Adds and returns a new text frame at the defined coordinates. 

 

textFrame.previousTextFrame = oldTF

 

makes that new text frame connected to the previous. 

TOPICS
Scripting

Views

78

Likes

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
Dec 19, 2020 0
Adobe Community Professional ,
Dec 19, 2020

Copy link to clipboard

Copied

Yes, there's a way.

 

textFrames.add({geometricBounds: [y1,x1,y2,x2]})

 

Adds and returns a new text frame at the defined coordinates. 

 

textFrame.previousTextFrame = oldTF

 

makes that new text frame connected to the previous. 

Likes

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
Reply
Loading...
Dec 19, 2020 0
New Here ,
Dec 20, 2020

Copy link to clipboard

Copied

Thank you!

It took some time to make it work, but it does the job!

Likes

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
Reply
Loading...
Dec 20, 2020 0
Adobe Community Professional ,
Dec 20, 2020

Copy link to clipboard

Copied

You're welcome. Newspapering is fertile ground for automation and where I cut my teeth on this stuff. Lots of trial and error!

Likes

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
Reply
Loading...
Dec 20, 2020 0
New Here ,
Dec 20, 2020

Copy link to clipboard

Copied

Indeed, it's not just about layouting as quick as possible, but also maintaining flexibility for last minute adjustments. Thanks again!

Likes

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
Reply
Loading...
Dec 20, 2020 0