Thanks for this!
This script fails to handle the case where animation goes past the edge of the page and continues on the next line (happens when exporting spreadsheet from Aseprite w/ "packed" setting).
Here is a git diff that fixes that: https://pastebin.com/aPWGLS0N