NT Productions shows how to create a script for Ae that can shatter layers into squares.
If you are looking for a way to dive into getting started with more advanced methods in Adobe ExtendScript, then this is the tutorial for you. NT Productions’ Nathan Lovell shows how to create a straightforward shatter script for After Effects using ExtendScript. When completed the script will let you take a layer and explode it into a bunch of squares.
Lovell covers how to create controls for the shatter effect with attributes that can customize the size of the pieces so that you can vary the look of the result. Lovell covers a lot of ExtendScript stuff in his tutorials. The last had a look into embedding project information and other data into a single script.