Between September and December, most of my working days are devoted to preparing school diaries and planners. One pain-point that I encounter with some diaries is the addition of a year-to-two pages planner. The planners usually look like this:
Apart from the events for each day that are on a layer above and updated each year, the base planner itself has two major wholesale changes:
- The initials for the days of the week; and
- The shading for weekends.
The initials are usually 365 threaded text frames that sits above a table containing the weekend shading. The text frames contain the initials of the days of the week, corresponding to the month and day they relate to, so changing the initials is easy. However, shading the cells containing Saturdays and Sundays on the table below takes time. Even if cell styles were used, they still have to be removed from the previous year’s appearance and applied to the appropriate year’s cells – subject to operator error.
Ideally, I was after a solution that would:
- Easily update all planner base dates in one go
- Shade all of the weekends without having to do this manually
- Adjust automatically for leap years
- Reduce any mis-dating via operator error
Didn’t I already write a script for this?
In 2018, I’d prepared a script to assist in the creation of wall planners that would allow for four types of layout configuration; and in 2020 was further improved to allow an output in one of 14 languages.
That said, this article isn’t meant to be a shameless plug of this script. The script is a great solution for creating new yearly planners. However, this solution requires updating existing planners. An additional solution had to be created.
The simple solution first
As I mentioned earlier, linked text frames that contain the appropriate days of the week initials. However, rather than use one paragraph style for these initials, each day of the week was given its own paragraph style e.g. Monday, Tuesday, etc.
The paragraph styles are based upon a base style that defines its basic appearance, with flourishes added to Saturday and Sunday in the form of paragraph shading. Each paragraph starts in its own text frame, and each paragraph style also refers to a next style feature to go to the next day’s style.
The days of the week are easy enough to prepare. The first way is quick but allows for operator error, and that is to type the 7 initials and their respective line breaks; and copying them 52 times, starting January 1st on the appropriate day.
The second (and more accurate way) is to make a new Excel file, type the start date in cell A1 and then with the cell selected, go to Fill, Series, and fill out the dialog box as shown
Once done, go to cell B1 and type: =CHOOSE(WEEKDAY(A1), “S”, “M”, “T”, “W”, “T”, “F”, “S”) and press return.
In the resulting cell, double-click the green square on the bottom right corner of cell B1 to automatically fill the remaining entries in the column.
From here, select column B, copy and paste it into the threaded text frames in InDesign.
Note – if it came in as a table, make sure to briefly change InDesign’s clipboard handling preferences to handle text and tables from other applications as text only.
Last thing to do is apply the paragraph styles. Take note of what day’s initial appears on January 1 (Friday in this case) and with the text cursor still visible in the text frame, select all type (Command A). From the paragraph styles panel, right click on the Friday paragraph style and choose Apply “Friday” then Next Style.
But this solution only fills two of the four criteria:
- Easily update a planner dates in one go
- Shade all of the weekends without having to do this manually
Adjust automatically for leap years Reduce any mis-dating via operator error
This solution does not take February 29 in leap years into account. In these instances, an extra text frame needs to be threaded to take in February 29, so is not completely automatic.
The over-engineered solution
I did prepare a solution outside of work hours that would meet all four criteria; but the setup of the file took more time than simply adjusting the previous planner. It would also be difficult for other operators unfamiliar with my techniques to carry out the alterations unless they were trained beforehand. Ultimately, the solution wasn’t practical for my day-to-day work and was never implemented, but it is worth looking at the solution as it uses a variety of InDesign’s features such as:
- GREP styles
- Table and Cell styles
- Rule above within Paragraph styles
- Linking to an Excel file
Both the InDesign file and Excel file can be downloaded here.
First thing is to create an XLS file that contains the yearly information that changes and link it in InDesign. Linking to an excel file can be done via InDesign’s preferences.
Linking to an XLS file can be fiddly and I’ve found the best way to maintain appearances of linked tables that are updated is to make sure that table and cell styles are applied to the table that will contain the incoming XLS data.
A glimpse at the XLS file shows that it contains the initials of the appropriate days of the week. Note that the initial letter is represented by two letters rather than one (which will be explained shortly). The year is off to the right-hand side for ease of updating the planner by just adjusting the year.
An even closer look at the XLS file shows hidden columns. If we unhide these columns, the workings behind the technique are revealed. To compensate for leap years, the calculation for February 29 has an if-else statement that says if a date appears here, add the appropriate weekday initial, but if there is nothing, leave it blank.
Back in the InDesign file, all cells contain a paragraph style that have a GREP style instruction that makes the first letter minuscule in size and width.
Why two letters for the days of the week and not one?
It is to do with how the shading of the cell is automated. The first letter is used to identify a weekend with the initial S and that letter is colorised with an appropriate color for the weekend. If the letter was a weekday, the first letter is set to none. To control the background color of the cell, the rule above feature of the paragraph style is used as it allows the [Text Color] option to be selected, and this color is the first character that the paragraph style encounters. The rule above is then made thick enough to fill the cell, and then the offsets are applied to fill the remaining parts of the cell.
Why not use the paragraph shading feature? Unfortunately, this feature does not have access to the [Text Color] option from the color dropdown.
Updating the data can present a trap, as instead of simply changing the date in excel and updating the file, the art needs to be relinked and then selected with the show import options dialog to only bring in specific cells, as the date at the far right isn’t required. In this instance, it is changing the cell range from A1:AA32 toA1:Y32 as shown:
So this will make the base for the planner, and all the further information into the particular dates is done on a layer above using a table with the same cell dimensions.
As mentioned, this is an over-engineered solution that wasn’t implemented, but its use of combining linked Excel files, GREP styles and Cell styles may have application for other purposes.