Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Batch script to automatically save Aseprite file into layer images for easy import into external animation applications such as Spine and Spriter Pro. (Batch script has to be in same directory and same filename as Aseprite file)
@echo off
@set ASEPRITE="C:\Program Files (x86)\Steam\steamapps\common\Aseprite\Aseprite.exe"
@set FILENAME="%~n0"
if exist %FILENAME% (
choice /c YN /m "Would you like to delete and recreate '%FILENAME%' directory "
if errorlevel == 2 goto save
if errorlevel == 1 goto delete
goto end
echo Saving %FILENAME%.ase as %FILENAME%/{tag}.png...
%ASEPRITE% -b %FILENAME%.ase --trim --save-as %FILENAME%{tagframe0}/{tag}.png
echo Saving %FILENAME%.ase as %FILENAME%/{tag}/{layer}.png...
%ASEPRITE% -b %FILENAME%.ase --trim --save-as %FILENAME%{tagframe0}/{tag}/{layer}.png
echo Finished saving images in %FILENAME% directory.
goto end
echo Deleting %FILENAME% directory...
rd %FILENAME% /s /q
goto save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment