Aseprite Script crashes when attempting to copy-paste between files
Ev-Abbott opened this issue · 0 comments
Ev-Abbott commented
Hello! I have an animated tile map I am trying to automate by copying the frames from a tile merged cell by cell into a new file. Selection and new frames work all well but when I attempt to paste my selection, the application crashes.
Script in Question:
do
local spr = app.activeSprite
if not spr then return app.alert "No Active Sprite" end
local basePath = "PathFromRoot/To/Tiles/Directory"
app.transaction(
function()
local current = app.open(basePath .. "/WaterTiles.aseprite")
local standardLayer = app.activeLayer
local newSprite = Sprite{ fromFile=basePath .. "/Test.aseprite" }
local newSpriteLayer = newSprite.layers[1]
for i = 1,8 do
local frame = newSprite:newEmptyFrame()
app.activeSprite = current
app.activeLayer = standardLayer
app.activeFrame = i
current.selection:select(Rectangle(0, 0, 16, 16))
app.command.CopyMerged()
app.activeSprite = newSprite
app.activeLayer = newSpriteLayer
app.command.Paste()
current.selection:deselect()
end
end
)
end
OS:
macOS BigSur 11.1
Any help would be appreciated!