Scripting a Calendar Generator

A couple of weeks ago I wrote a post about my Photoshop automation project for generating single page photo calendars. Phototrice includes a new calendar every week as part of our regular Friday Photo feature. Actually two calendars are produced every week with North America and international weekday formats. Creating two calendars a week is not all that labor intensive but creating two calendars fifty two times a year is something worth automating. The coding on the calendar generator was completed about a week ago. I used it to generate last week’s Friday Photo calendars without a hitch.

This project was put together using Visual Studio 2015 and VB.Net. As mentioned in the last post, external automation provides many more options for integrating functionality that cannot or should not be scripted to run directly in Photoshop. Of course this approach limits me to running under Windows but that is what I use anyway. Future projects will likely be coded in JavaScript or ExtendScript to make them platform independent.

The application GUI is quite simple. I can enter all necessary information and kick off the generator which is about all that is required. A SQLite database is used to store various kinds of information for the generator. Right now configuration and logging data are the primary items stored. Eventually it will contain all information and images required to create any previous calendar. This will be useful for my yearly compilation of calendar images in book form.

Calendar Generator GUI
Calendar Generator GUI

The application lends itself quite easily to other uses where templates and dynamic data are combined to produce finished documents. Right now I’m working on a series of custom postcard templates which will also use the generator. Table driven configuration allows for great flexibility in layout and template selection. Coding was done using normal object oriented techniques. This allows me to extend or repurpose functionality as necessary.

Calendar generator configuration table
Calendar generator configuration table

This is the first time I have created code to script or automate Photoshop. I have learned some very useful things about how Photoshop operates by analyzing the API model. That information gives me insight into how to accomplish various tasks with or without scripting. The experience of writing code for Photoshop has been good overall. The documentation is accurate and detailed which is not always the case many application API’s. I expect to build other useful scripts in the months ahead. Hopefully I can make scripts available on Phototrice at some point. Anyway that is my goal.

Ken

Author: Ken

Avid photographer and old guy technologist.