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

Change baseline grid in multiple files in one go?

Tagged: 

Return to Member Forum

  • Author
    Posts
    • #91032

      As the title really – is it possible to change the baseline grid in a set of 60+ files all in one operation?

      I’ve a publication which has been split into separate INDD documents, one for each spread, and it’s not even combined into a book. I know, it wouldn’t be my choice for setting it up, but we have to work with what we’re given here.
      At least the existing baseline grid is the same in each of the files.

      Would this be scriptable? My scripting skills are very limited.

      I found this thread from 2010:

      settiing baseline grid and preferences in an InDesign book


      which is related, but didn’t seem to be of any help.

      Thanks in advance,
      Chris.

    • #91036

      Hi Chris, this is possible with very minor steps:

      1. Download the batch converter from Peter Kahrel: https://www.kahrel.plus.com/indesign/batch_convert.html

      2. Expand the file and copy it to your scripting folder

      3. Save these lines as plain text with extension jsx and copy the file to your scripting folder

      function main() {
      app.activeDocument.gridPreferences.properties = {
        baselineColor: UIColors.lightBlue,
        baselineStart: 15,
        // baselineGridRelativeOption: BaselineGridRelativeOption.TOP_OF_PAGE_OF_BASELINE_GRID_RELATIVE_OPTION,
        baselineGridRelativeOption: BaselineGridRelativeOption.TOP_OF_MARGIN_OF_BASELINE_GRID_RELATIVE_OPTION,
        baselineDivision: "22pt", // Increment Every
        baselineViewThreashold: 50,
        baselineGridShown: true,
        gridsInBack: false
      }
      } 
      main ();
      

      If you do not need a line, simply remove it. Note, that “//” is a comment. So these two lines are either/or. Simply comment or remove the other line, if the current result is wrong.

      4. Start the batch converter script: Input/Output > your folder, Ignore errors and Overwrite existing file > checked, Run a script > Select here your saved script, Saved changed documents on closing > checked

      Kai

    • #91038
      David Blatner
      Keymaster

      I’m sure this is scriptable. For example, you could create a script that does it to one document, and then use Peter Kahrel’s Batch Convert script or something like it.

      But if would take about 1 minute to open each file, change the setting, save it, and close it, right? Maybe 1.5 minutes. For 60 files, that means the change would take 90 minutes.

    • #91039

      Thanks people.
      I’m waiting to see if it’s actually going to be needed (instructions from on high), and then I’ll weigh up the time factor for doing it manually versus the learning curve for the batch script method.

      and Kai,
      1. the double slashes mean everything to the right is commented out, right?
      2. Threashold or Threshold? It’s without an A in my preferences dialog box.

      and David,
      I think I can get it down to 30 sec per file with hardly any mouse movement – a judicious keyboard shortcut to open the right part of the prefs dialog, then tab to the right box, paste the value, return, save, move on.

      Thanks again,
      Chris.

    • #91041

      Haha, writing the script: 5 minutes, writing the post here: 7 minutes, installing everything: 2 hours, BUT. Running the script 1-2 minutes!

      So Chris, I gave you everything that is needed. It should not take longer than 15 minutes for you to set up everything! A user with a bit experience would need maybe 2 minutes.

      To your questions:
      1. yes. You have the option to align Top of page or Top of margin. So use only one of those 2.
      2. baselineViewThreshold: 50 (interesting to note, that a wrong writing is ignored in this case)

      Kai

    • #91045
      David Blatner
      Keymaster

      Thank you, Kai! That was really nice that you wrote that. (I wrote my reply before I saw your script. We must have been typing at about the same time.)

      My comment was simply that a lot of people spend a lot of time thinking “I wish I had a script” but when you think about it, it might cost $50 or $200 to have someone write a script, vs hiring someone for $20/hour to work for 2 hours on it. :-)

      I wish we had a “donate” button here, so that people could click to donate $25 or $50 to the script writer. Maybe we should explore how to do that.

    • #91046

      As it turns out, the Design Guru Who Must Be Obeyed decreed that the baseline grid has to stay the same.
      Which solves this problem but introduces a whole load more, of the quart-in-a-pint-pot variety (Kai, is there a German version of that saying?). At least I’m accustomed to dealing with that type of problem.

      Thanks again Kai and David for the quick responses. I hope they prove useful to someone.
      Chris

    • #91047

      I vote for that donate button too, either to the scripter or the forum, cause scripts should not provided for free!

      Let me explain, why I provided sometimes scripts for free nevertheless: In the past 20 years I learned most of my knowledge from lynda.com or forums like these. So why not give something back when it does not cost me much. That means, if the goal is clear, there are no testfiles needed, it takes not longer than 5-10 minutes and it saves hours of work …

      @David: If I have the decission spend $40 for a freelancer or $100 for a script, I would always vote for the script! In this special case, there are maybe 2-4 steps needed per document. So chances are good, that a freelancer will miss step 2 and 4 in 7 or more documents ;-)


      @Chris
      : A big benefit of scripts: If it works, it works! In 60 or 600 documents …

      Kai

    • #91063
      David Blatner
      Keymaster

      Kai, that is a great point: A script is usually much more precise/accurate than a human. :-)
      Also, you can use the script many times, making small changes when necessary, so it is a good investment.

      We really appreciate your “giving back” to the community!

Viewing 8 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads