Skip to content

Instantly share code, notes, and snippets.

@dacap
Created April 11, 2022 00:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dacap/7d954e6396c450f3a8a6cfbc584b1726 to your computer and use it in GitHub Desktop.
Save dacap/7d954e6396c450f3a8a6cfbc584b1726 to your computer and use it in GitHub Desktop.
Assign a key to play a tag named "TagName"
local spr = app.activeSprite
if not spr then return end
for _,t in ipairs(spr.tags) do
if t.name == "TagName" then
local old_play_once = app.preferences.editor.play_once
local old_play_all = app.preferences.editor.play_all
app.activeFrame = t.fromFrame
app.preferences.editor.play_once = true
app.preferences.editor.play_all = false
app.command.PlayAnimation()
app.preferences.editor.play_once = old_play_once
app.preferences.editor.play_all = old_play_all
break
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment