Automatic Import Spritesheet script

I’ve been experimenting a bit with creating some very simple scripts, but I can’t figure out how to make one that calls the Import Spritesheet command (skipping the UI menu) and automatically detects and fills in the correct dimensions. The spritesheets I’m working with are horizontal strips with a single animation and can all be easily divided into frames where the width and height are the same.

This was my own attempt, I’m struggling with how to skip the menu and how to send the values to the command:

local sprite = app.activeSprite

app.command.ImportSpriteSheet{
	use-ui = false,
	x = 0,
	y = 0,
	width = sprite.height,
	height = sprite.height
}
1 Like

Welcome @djentalist! Actually I’m seeing the code of Import Sprite Sheet and it doesn’t support ignoring the UI (yet). I’ll add this, something to do (the Import Sprite Sheet needs some love, there are a lot of new options we would like to add in the future).

4 Likes

Awesome! I’ve noticed it’s a powerful tool, so I’m definitely looking forward to it. Meanwhile Aseprite has more than enough other features to keep me busy.

1 Like

We’ve added some options for ImportSpriteSheet in v1.2.26 now.

2 Likes

Thanks so much for the update!

1 Like