Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Paragraph Style conversion

Return to Member Forum

  • Author
    Posts
    • #114515
      David Loveday
      Participant

      Hello:
      I’m using InDesign CC2018 on Windows 10, and I’d like to know if there is a script that will batch-convert Paragraph styles from a single “master document” to about 1,000 documents. The style names (at least two dozen) will remain the same, to prevent confusion with users, but the font names and certain font sizes need modifying. I realize that a certain amount of repagination of the finished product will be required, but I want to avoid the laborious importing of the new Paragraph styles for each document. All of these documents are in folders numbered 01 through to 20, and each folder is subdivided into two folders, such as 01EN, 01FR, 02EN, 02FR, etc., in each of the numbered folders.
      Thank you for your help.

    • #114599
      Tamás Nagy
      Participant

      Hi David,

      I have a script ready that asks you to select one document as the source of all text styles and in a 2nd step asks you to seletc all docs in which you want to update these styles from the source. Finally it starts to refresh text styles in all the selected target docs.

      It is not foolproof, it talks to you in Hungarian but it worked for me. :D

      Is it what you need?

      Tamás

    • #114601
      Tamás Nagy
      Participant

      Anyway, here’s the translated script, use it, if you wish! :)
      I will try to put the whole between ‘code’ tags, I hope it will work. If not, the tag is of course not part of the script. :D


      var myInputfiles=[];
      var myDoc, myStyleDoc;

      var myInitPath="~/Desktop/";
      if (File.fs == "Windows") myInitPath="C:/";

      myGetStyleFile();
      myGetfolderfiles();

      for (var i=0; i<myInputfiles.length; i++) {
      app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
      myDoc=app.open(myInputfiles[i],true,OpenOptions.OPEN_ORIGINAL);
      app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
      myDoc.importStyles(ImportFormat.TEXT_STYLES_FORMAT,myStyleDoc,GlobalClashResolutionStrategy.LOAD_ALL_WITH_OVERWRITE);
      myDoc.close(SaveOptions.YES);
      };

      function myGetfolderfiles(){
      var myPath=new File(myInitPath);
      myInputfiles=myPath.openDlg("Select all documents to refresh text styles in!",undefined,true);
      if (myInputfiles==null) {alert("You didn't choose any docs, script terminates.","Error"); exit() };
      };

      function myGetStyleFile(){
      var myPath=new File(myInitPath);
      myStyleDoc=myPath.openDlg("Select the document to be the source of text styles!",undefined,false);
      if (myStyleDoc==null) {alert("You didn't choose a source doc, script terminates.","Error"); exit() };
      };

    • #114602
      Tamás Nagy
      Participant

      Hmm… almost.

    • #114603
      David Loveday
      Participant

      Great! Thank you so much Tamás. I’ll give it a try and let you know as soon as I can…
      Regards.

      David

Viewing 4 reply threads
  • You must be logged in to reply to this topic.
Forum Ads