I've been tinkering with these scripts for the last few months as part of our game development. I've decided to make them available incase they're helpful to others using Spine.
They're up on github here:
https://github.com/Bee-Cave-Games/spine_export
From the README:
Spine Export Scripts
Scripts to export Adobe Photoshop and After Effects content to Esoteric Software's Spine animation tool JSON format.
After Effects Export with ae_to_spine.jsx
The ae_to_spine.jsx script exports a lot of animation data from After Effects, but not everything. Things that are supported:
Image layers
PNG sequence layers
Layer hierarchy (parenting)
Translation, rotation, scale, opacity keyframes (stepped or linear only)
Composition layers (nested compositions)
Per-layer in-point and out-point (visibility)
Time remapping
Additive blend mode
Things that are not supported:
Warp effects, puppet animation, etc. (no deformation)
Glows, shadows, etc. (no effects)
Masks of any kind
Color transformations of any kind
Plugin effects, like particles, etc.
Some of these limitations are easier to work around than others. For example, if you are warping an image, consider rendering out the warping animation to a PNG sequence and using that as a layer.
For particle effects, render those out as a separate PNG sequence as well. Use a lower resolution if you can to save texture space.
Same goes for glows, shadows, and other effects. They can be rendered out, added as another layer, and faded in and out using opacity, often at lower resolution.
Photoshop Export with psd_to_spine.jsx
There is an official photoshop export script from Esoteric Software. This one was written mainly to work with the new Photoshop CC 2013 image generator feature.
http://blogs.adobe.com/photoshopdotcom/2013/09/introducing-adobe-generator-for-photoshop-cc.html
psd_to_spine.jsx only exports layers that are named with ".png" in their name. It takes into account any declared scale, if there is one. For example, "25% foo.png" will use write out a PNG that is 25% of the layer size, but add "scaleX": 4.0, "scaleY": 4.0 to the Spine JSON output.
psd_to_spine.jsx also exports Groups as bones, and uses relative positions for the layers within the Group/bone.
The following Layer attributes are exported:
Some notable things that aren't supported:
rotation (Even for smart objects, this just isn't something that's accessible through scripting)
blend modes other than "additive". (Would love for Spine to support more!)
Eliminating duplicate images
Regarding duplicate or mirrored images, the workflow we've adopted is to use duplcated and/or mirrored objects all we want in Photoshop, but once we export for Spine, edit the JSON and replace all duplicate image references with a single image reference. Various texture packer or atlas generators can do this job as well. The point is, look for opportunities to re-use the same texture in Spine if possible.
Support
If you run into something that should work but doesn't, feel free to comment here or post an issue on github.