@robindx, @hermeneut, and others:
The script is working over here, and debugging shows no errors ( DEVONthink 2.8.6 on 10.10.5). When you say “it” fails please explain what version “it” is. The most recent one that Frederiko posted is here:
and I’m not able to make it fail.