Skip to content

Instantly share code, notes, and snippets.

@Shilo
Created April 27, 2019 09:50
Show Gist options
  • Save Shilo/de5462a11212d32b3d0d3174318e5d88 to your computer and use it in GitHub Desktop.
Save Shilo/de5462a11212d32b3d0d3174318e5d88 to your computer and use it in GitHub Desktop.
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
)
:save
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
ren %FILENAME%0 %FILENAME%
echo Finished saving images in %FILENAME% directory.
goto end
:delete
echo Deleting %FILENAME% directory...
rd %FILENAME% /s /q
goto save
:end
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment