Can scripts export frames?

Exporting my sprites is a rather complex task. I currently do iit via the command line and would love to use scripts for this so I can make decisions based on things like number or names of layers, etc.

Is this possible with scripting? What I need to do is write a frame out with a given filename. I don’t see any API functions for this.

1 Like

I feel you there, I wrote a simple batchfile to accomplish this with the CLI as my player character file has a ton of frames and multiple iterations of armor tiers. Still a smidge of manual work but it speeds things up very much so.

D:\SteamLibrary\steamapps\common\Aseprite\Aseprite.exe -b player_master.ase --save-as Player_armor_T1-{tag}-{tagframe1}.png

So to explain this i would have the player layers and the Tier 1 armor layer on, and the file saved in this configuration. Running the .bat file in the same folder as the player_master.ase file is and it will dump all the frames formatted as Player_armor_T1-East_strafe_north-1.png and so on.

To export the tier 2 armor I will simply change the .bat script to D:\SteamLibrary\steamapps\common\Aseprite\Aseprite.exe -b player_master.ase --save-as Player_armor_T2-{tag}-{tagframe1}.png

And turn on the relevant layers for tier 2 armor, save, and repeat.

Having it utilizing the tag name to affect the filename was such a godsend as an alternative to manually exporting each tag manually because the base player file has 100 frames and many different tags.

Hope this helps!
Let me know if you have any questions.

This is exactly what I’m doing currently, but what I want is to use Aseprite scripts to export since Sprites (for example) with a layer “weapon” needs to be exported differently than a sprite with a layer “armor”. I can have two bash files, but I’d like the exporter to be contextually aware and that can only happen with true Aseprite scripts.

1 Like

My apologies, I somehow missed that in your original post (not enough coffee this morning)

That would be a fantastic plugin that would open up a lot of options.