How to take a screenshot on your Mac — Apple Support
The basic process is this: Use Cmd-shift-4-spacebar to capture a screenshot of the window for each frame. Convert the images to gif (or set your screenshot preferences to gif prior to capturing the screenshots) Open the last screenshot in preview.