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

Script for paragraph to text frames

Community Beginner ,
Apr 23, 2020 Apr 23, 2020

Hi everybody

Can you please help me for the below script :  

 

I have a document where i have to split the text of each spread by paragraph, so i'm using the script split.text for that!

 

Screenshot 2020-04-24 at 08.41.30.png

 

 

Can this be done by an script, like go on the first page, select the text and run the script split text, and go the same for the other spreads.

 

i'm trying the below but don't know how to continue!

 

var myObjectList = app.activeDocument.textFrames.everyItem().getElements()  

 

Thanks

TOPICS
Scripting
2.3K
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
People's Champ ,
May 14, 2020 May 14, 2020

The latest version of InDesign comes with a script I wrote, called "Break Text Thread." It's in the "Community Scripts" folder in the Scripts Panel. Check out that code, it shows a lot of ways of breaking the text threads between frames.

HTH,

Ariel

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 Beginner ,
May 14, 2020 May 14, 2020

Hi Ariel,

 

Thanks for your reply, i know that script, its very useful. As its name says, it Breaks Text Thread.

But for my case, i need to break the paragraphs to text box.
As you can see below: 

Screenshot 2020-05-14 at 13.52.35.png

Actually i have to go on each page, select all run the script Split Text and do the same for each pages,
thats why i wanted to automate this process.

 

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
People's Champ ,
May 14, 2020 May 14, 2020

I'm not familiar with the SplitText script. But if you can turn it into a function that accepts a single text frame as a parameter (rather than relying on the current selection), you can then loop through all text frames in the document (and the little code snippet you post above is a good start for a getting an array of all those text frames) and call the SplitText function with each frame in turn.

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 Beginner ,
May 14, 2020 May 14, 2020

I'm a beginner in scripting, thats why i have posted it here to see if someone could help me to complete the script i have started to call the SplitText.

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 ,
May 14, 2020 May 14, 2020

From where did you get this script? Unless we see the script we can't help you more. As Ariel pointed its not a complex change at first look you just need to change the code from selection to accepting objects for which you already have posted the code.

If you bought this script its better you ask the developer to make this change for you

 

-Manan

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 Beginner ,
May 14, 2020 May 14, 2020

i have downloaded that from the net.
As you can see on the first screenshot, its a jsx.bin, so i can even edit it !

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 ,
May 14, 2020 May 14, 2020

In that case i think you will have to contact the original developer. if this was a script without UI then we could call it within a loop by altering the selection as needed, but here the script is triggered by the ok button so it's not possible to control it externally

 

-Manan

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 Beginner ,
May 14, 2020 May 14, 2020
LATEST

Thanks for reply and for your 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