Skip to main content
hamdifem
Inspiring
September 30, 2014
Question

Is it possible? with a script in a test question numbers automatically assign

  • September 30, 2014
  • 1 reply
  • 302 views

I've got a 400-page document

every question in the text frame and after point after the point tabs

in text frame question numbers mixed and I want to fix as in the picture

This topic has been closed for replies.

1 reply

Legend
September 30, 2014

Try this,

var myDoc = app.activeDocument, question_no=0;

for(var p=0; p<myDoc.pages.length; p++)

{

    for(var i = myDoc.pages

.textFrames.length-1; i>=0; i--) 

    { 

        question_no++;

        myDoc.pages

.textFrames.texts[0].select();

        app.findGrepPreferences = app.changeGrepPreferences = null;

        app.findGrepPreferences.findWhat = "^\\d+.\\t";

        app.changeGrepPreferences.changeTo  = question_no + ".\t";

        app.selection[0].changeGrep();

        app.findGrepPreferences = app.changeGrepPreferences = null;

    }

    question_no = 1;//If you want continuous page number throughout the document, then hide this line

Vandy

hamdifem
hamdifemAuthor
Inspiring
September 30, 2014

This script from the first text frame created numbering begins

whereas mixed was created

ranking first left top-down, after right the top-down is it possible to