Chapter Number Text Variable Scripting

Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Chapter Number Text Variable Scripting

Viewing 1 reply thread
  • Author
    Posts
    • #105083
      Mario Davila
      Member

      I am very new to scripting but I am looking to add to a current script I am using to update TOCs in my book file.

      Is there a way to call the chapter number text variable and move its frame to a differnt X,Y position dependent on the chapter number?

      So i would like the script to: Update TOCs > Update chapter number text variables > Update location of chapter number text variable frames to its corresponding number’s location (10 different locations possible)

      var myBook = app.activeBook;

      for(var n=0; n < myBook.bookContents.length; n++)
      {
      app.open(File(myBook.bookContents[n].fullName.toString()));
      for (var i = 0; i < app.activeDocument.allPageItems.length; i++)
      {
      var myPageItem = document.allPageItems[i];
      if(myPageItem.getElements()[0].constructor.name == “TextFrame”)
      {
      myPageItem.select();
      try{
      app.scriptMenuActions.itemByID(71442).invoke();
      }catch(e){}
      }
      }
      app.activeDocument.close(SaveOptions.YES);
      }

    • #105098

      I noticed you asked this in several other forums as well.

      I suppose that means it’s no use looking for yet more answers here, because (hopefully) you only need one single solution.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.
>
Notice: We use cookies on our websites to give you a great online experience. If you keep browsing, we'll assume you're ok with this. For more information, see our privacy policy. By closing this banner, you agree to the use of cookies.I AGREENo