I’d like there to be a way to have it so each time you make a loop it will number them for you. Like if you make a loop that would be loop1 then making another would be loop2. As it is right now if you make loops you have to name them or the second loop with replace the first. It’d also be nice to have a way to opt in having the loop settings pop up when making a loop.
This is possible with a script. I have prototyped one, but needs thorough testing/refining.
1 Like
you script makers are a godsent. I look forward to whenever it is available ![]()
Here is the script, do report any issues:
-- Created by MrSmithr
-- Aseprite (v1.3.16-beta2) Script Release • 23/10/2025
-- DISCLAIMER: Provided as-is with no warranty. Use at your own risk.
-- If this script helped you, consider supporting me ❤️ https://ko-fi.com/mrsmithr
--
local spr = app.activeSprite
if not spr then
return app.alert("No active sprite.")
end
local range = app.range
if not range or range.isEmpty or not range.frames or #range.frames == 0 then
return app.alert("Select one or more frames first.")
end
local nums = {}
for _, fr in ipairs(range.frames) do
table.insert(nums, fr.frameNumber)
end
table.sort(nums)
local runs = {}
local rS, prev = nil, nil
for _, n in ipairs(nums) do
if not rS then
rS, prev = n, n
elseif n == prev + 1 then
prev = n
else
table.insert(runs, {from=rS, to=prev})
rS, prev = n, n
end
end
if rS then
table.insert(runs, {from=rS, to=prev})
end
local base = (app.activeLayer and app.activeLayer.name and app.activeLayer.name ~= "")
and app.activeLayer.name
or "Loop"
app.transaction(function()
for i, r in ipairs(runs) do
local tag = spr:newTag(r.from, r.to)
tag.name = string.format("%s_%d-%d", base, r.from, r.to)
tag.color = app.fgColor
end
end)
app.refresh()