Hrmmm, the API has a bunch of limitations on the images you can
assign to a token. They need to be in your library, and they need to be
the thumb sized version (AFAIK). I think the easiest way to do it
would be to create a Rollable Table/Token with all the animations you
want on different sides, then use either a custom script or just a macro
with a bunch of tokenMod commands to set the correct Side/Height/Width,
and set the Top/Left position from the token you'd like to play the
animation over. Then you'd just need an "animation off" macro
which changes the token to side 1 (a transparent png) and moves it to
[70,70] or somewhere out of the way. It's a bit fiddly, but
creating a fresh token with a GIF isn't possible through API as far as I
know. I only have a couple in my Library, but they're converted to
.webm and don't appear to have a .thumb version, so you can't apply them
to tokens on the fly. As for the timing of the
animation, if you want to include that you'd probably need to go for the
custom script option - you can call tokenMod from there to keep it
simple if you'd like, but you can at least store an object in your
script that has the 'settings' for each animation. Kind of a mock-up of what I'm talking about: // animation settings object const animation = { off : { side : 1 , width : 70 , height : 70 , timer : null }, leaves : { side : 2 , width : 140 , height : 210 , timer : 3000 , } } // Command line for animation handleInput ( /* grab the animation you want from a chat macro, e.g. !anim --leaves --druidLady */ ); // Grab whatever other info you need getData ( /* grab top/left coordinates of druidLady */ ); // Let tokenMod do the heavy lifting sendChat ( /* tokenmod --set commands with animation.leaves.side, animation.leaves.width etc. etc. */ ); // Use a timer if it's set, otherwise you can use a manual macro to switch it off if ( animation . leaves . timer > 0 ) { setTimeout (() => { sendChat ( /* tokenmod --set commands for the "animation off" side of the token */ ); }, animation . leaves . timer ); } Or.... maybe a script already exists that will do it all for you! Or... maybe this a stupid way to do it anyway! But it would probably work. edit - I'm assuming you'd like the animation to play in addition to having the character token on the canvas, replacing the /fx essentially