autoCrat remains the most popular of scripts I've written, which I suppose makes sense given that it is a straight-ahead Document Merge from spreadsheet that offers much flexibility -- conditional merge, field-mapper, form triggers, and editor/viewer merge -- all via a reasonably intuitive user interface.  In the past 30 days, according to Google Analytics, the script has  produced 43,000 merged Google Documents or PDFs.

So just as I was getting complacent (cocky, even?) about this script,
+Jesse Spevack , Assistant Principal extraordinaire of the NYCiSchool notified me that it was failing under another of his ridiculously awesome edge-cases (Jesse runs a school that attempts to completely personalize 400 high school student programs based on student interest and he breaks everything I make)  He was producing custom schedules for students in Google Docs involving upwards of 80 unique columns of data and the autoCrat was doing 7 rows of data in 5 minutes, timing out, and not restarting.

I did some head-scratching, followed by a full morning of deep debugging and discovered that apparently I was something of an imbecile when I first wrote the script, 6 months ago.  Amongst lots of redundant code, there were multiple calls to sheet.getRange() INSIDE a loop, INSIDE the merge rookie move, and the most costly scripting error one can make....needlessly executing over every column in the sheet for each row... hence the total fail, and general sluggishness of autoCrat on big jobs.  Ack.

In any case, after some self-flagellation, I'm happy to announce that autoCrat V3.7 was published today.  This release fixes two key issues:

1) Jobs with many columns of merge data should now run 10-20X faster.

2) When the script times out, it should actually restart, as it says it will, rather than just time out.

As a reference...Jesse's job was doing 80-90 rows in 5 minutes, with the clever add on of including the student as a VIEWER on their own schedule, which results in an email to each student linking them to their program.

If you need to replace autoCrat on an existing spreadsheet, remember that you can export your settings from the "Advanced Options" dialog, delete the script from the File menu in the script editor, re-install from the gallery, then paste your settings into the autoCrat_preconfig function before running the initial installation.

Thrilled to be working with such fearless and supportive users.  Keep breaking this stuff!
Shared publiclyView activity