% this filename is main.tex
% compile it with "pdflatex -shell-escape main" (without the quotes)
\documentclass{article}
\usepackage{filecontents}
% Create a PDF file that consist of some pages
\begin{filecontents*}{"heart animation.tex"}
\documentclass[border=12pt,pstricks]{standalone}
\usepackage{pst-plot}
\usepackage[nomessages]{fp}
\FPeval\Delta{round(2*pi/30:2)}
\def\x(#1){sin(#1)^3}
\def\y(#1){(13*cos(t)-5*cos(2*t)-2*cos(3*t)-cos(4*t))/16}
\psset{algebraic,plotpoints=300}
\begin{document}
\multido{\n=0.00+\Delta}{31}{%
\begin{pspicture}[showgrid=false](-2,-2)(2,2)
\psparametricplot[origin={0,0.15},linecolor=red]{0}{\n}{\x(t)|\y(t)}
\end{pspicture}}
\end{document}
\end{filecontents*}
\immediate\write18{latex "heart animation.tex"}
\immediate\write18{dvips "heart animation.dvi"}
\immediate\write18{ps2pdf "heart animation.ps"}
% sometimes you need to disable auto rotate in ps2pdf. Please follow up if you really need it!
% delete auxiliary files generated by the 3 commands above.
\makeatletter
\@for\x:={tex,dvi,ps,log,aux,out,toc,nav,snm}\do{\immediate\write18{cmd /c if exist "heart animation.\x" del "heart animation.\x"}}
\makeatother
\usepackage{animate}
\begin{document}
%\animategraphics[controls,autoplay,loop,scale=<integer>]{<frame rate>}{<PDF filename without extension>}{<left blank>}{<left blank>}
\animategraphics[controls,autoplay,loop,scale=1]{10}{"heart animation"}{}{}
\end{document}
How to make \animategraphics happy with a file name with spaces?

heart_animationbe a solution? – tohecz Sep 28 '12 at 11:55.batfile? – egreg Sep 28 '12 at 12:15animategraphicsaccepts spaces in a file name enclosed in double quotes, but instead ofheart animationlooks forheartanimation. – egreg Sep 28 '12 at 12:57