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

Thread Frames through script

Enthusiast ,
May 02, 2024 May 02, 2024

Copy link to clipboard

Copied

I have some circled textframes which I want to thread together using script and in each text frame I would like to place a counter of my choice. The counter is a number which I want to give manually.

 

Some examples of the counter is:

ex1: A-2234 onwards ...eg A-2235, A2236, A-2237 respectively in separate text frames.

ex2: B-0001 onwards...eg B-0002, B-0003, B-0004 respectively in separate text frames.

 

I have written a script to thread the frames but its threading hapazardly.

I have attached a screenshot with before and after run of the script. Also when the script ends, it gives an error.

 

Here is the script. It just threads. Once threading is perfect, I will place the counters using a variable.

 

frames = app.selection;
//alert(frames.length);
for(i=0;i<frames.length;i++){
frames[i].nextTextFrame = frames[i+1];
}

 

 

Currently the matter is in one page. It may run through multiple pages.

 

What mistake am I doing ?

 

Thanks

TOPICS
How to , Scripting

Views

915

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 , May 09, 2024 May 09, 2024
quote

@Robert at ID-Tasker I have come up with the following script where I have followed process mentioned by @Laubender and assigned the story to frame by the process suggested by you, but still it shows only 1 \n char in first frame only. I have tried with 5 textframes only for testing. Screenshot of the output is attached.

var output = String('\n', 5);

 

By @shahidr100

 

Looks like this doesn't work as per example I've found on some website, sorry.

And you should use '\r' rather than '\n'.

 

Thi

...

Votes

Translate

Translate
Community Expert ,
May 09, 2024 May 09, 2024

Copy link to clipboard

Copied

LATEST
quote

@Robert at ID-Tasker Thank you so much. It worked.


By @shahidr100

 

You are welcome. 

 

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