This is the scripting API for Aseprite. Since Aseprite v1.2.10 you will be able to create scripts with Lua.
You can find some examples for this API or some tests.
Generally you will want to write a script to solve a problem or to do a little experiment, so you have five main options to approach your idea:
- Transform the active sprite: In this case
app.activeSprite will give you access
to the current sprite (it's
nil
if there is no active sprite, e.g. we are in theHome
tab). - Generate a new sprite : Here the Sprite() function creates a new sprite and sets is as the active one. From there you can modify the Sprite object as you want.
- Open one or several existent files: You can use app.open to load a sprite from the disk and then modify it.
- Save the modified sprite: After you have done some modifications to a sprite, you might want to save the result directly to the disk, Sprite:saveCopyAs() function is a good option to export the modified sprite.
- Show a dialog to the user: The Dialog object gives you the possibility to show controls to the user to enter values.
- Globals namespaces
- Constants
- Classes/objects
- Lua libraries
- Basic Functions
- Coroutine Manipulation
- String Manipulation
- UTF-8 Support
- Table Manipulation
- Mathematical Functions
- Operating System Facilities
- Some functions like
os.remove
,os.rename
,os.exit
,os.tmpname
are not available yet - Other functions like
os.execute
andio.open
will ask for permissions to the user
- Some functions like
- The Debug Library