Let's start with some context. All of the contraptions in WigglyKit share the convention of an "animation value" consisting of a dictionary with the keys "frames" (a list of images) and "order" (a list of integers; indices into the list "frames"). There's nothing intrinsically special about this dictionary; it's just a convention to bundle together all the relevant information for a wiggly animation such that it can be easily moved around between those contraptions and manipulated with scripts.
WigglyKit offers an example of pulling the animation value out of a WigglyCanvas and then saving it as a GIF:
v:wc.value # (optionally) make the background opaque: v.frames:v.frames..copy[].map[0 dict 32] gif.frames:v.frames @ v.order gif.delays:10 write[gif]
As noted in the Decker reference manual for the built-in function write[] (see note 12), to save an animated GIF we need to call write[] with a dictionary with the keys "frames" (a list of images) and "delays" (a list of integers; how many 100ths of a second should each frame be displayed?)
So really, what we need to do to save a GIF outside the specific context of WigglyKit is make an appropriately-shaped dictionary and hand it to write[]:
gif.frames: ... # obtain or assemble a list of images, somehow gif.delays: 10 # one number applies the delay to every frame write[gif]
Obtaining/assembling that list of images will depend entirely upon your use case. We might grab them from a sequence of canvases:
gif.frames: (c1,c2,c3)..copy[]
We could do the above in a more verbose way, if we wanted:
gif.frames: c1.copy[],c2.copy[],c3.copy[]
Or perhaps we could use the recently-added ".images" attribute of rich-text fields to grab all the inline images stored in a field:
gif.frames: myRichTextField.images
Etc.
Does that help point you in the right direction?