How can I automate GIF to PNG with Preview using AppleScript? I have a GIF file but I can open it only with Preview because it is a little bit ruined (GIMP or other programs does not open it correctly but it works with Preview).

I want to export it to PNG files. As far as I know the only way to do it is:


Manually select the next frame
File → Export
Choose the right format to export and specify the path
Click Save and repeat


I'd like to automate it. Some advice?
You could also try using ImageMagick:

convert -coalesce animation.gif frame%04d.png


You can install ImageMagick with brew install imagemagick or sudo port install imagemagick.