How do I insert text into the footline of a specific slide in Beamer?

This provides a new template/font/color footline extra and a macro \footlineextra to add text to the footline.

\documentclass{beamer}    
\title{Adding extra text to footline}
\author{R.J.~Drofnats}
\institute{University of St. Anford}

\useoutertheme{infolines}% for example, ymmv

\makeatletter
% add a macro that saves its argument
\newcommand{\footlineextra}[1]{\gdef\insertfootlineextra{#1}}
\newbox\footlineextrabox

% add a beamer template that sets the saved argument in a box.
% The * means that the beamer font and color "footline extra" are automatically added. 
\defbeamertemplate*{footline extra}{default}{
    \begin{beamercolorbox}[ht=2.25ex,dp=1ex,leftskip=\Gm@lmargin]{footline extra}
    \insertfootlineextra
    %\par\vspace{2.5pt}
    \end{beamercolorbox}
}

\addtobeamertemplate{footline}{%
    % set the box with the extra footline material but make it add no vertical space
    \setbox\footlineextrabox=\vbox{\usebeamertemplate*{footline extra}}
    \vskip -\ht\footlineextrabox
    \vskip -\dp\footlineextrabox
    \box\footlineextrabox%
}
{}

% patch \begin{frame} to reset the footline extra material
\let\beamer@original@frame=\frame
\def\frame{\gdef\insertfootlineextra{}\beamer@original@frame}
\footlineextra{}
\makeatother


\setbeamercolor{footline extra}{fg=structure.fg}% for instance


\begin{document}

\begin{frame}\maketitle\end{frame}

\begin{frame}{foo}
\begin{itemize}
\item one
\item two
\item three
\end{itemize}
\footlineextra{Source: ``Mr. Lee'' by the Bobbettes}
\end{frame}

\begin{frame}{bar}
\begin{itemize}
\item Able
\item Baker
\item Charlie
\end{itemize}
\footlineextra{Source: \emph{What do People Do All Day?} by Richard Scarry}
\end{frame}

\begin{frame}{baz}
No footlineextra here
\end{frame}

\end{document}

Having spent an hour on this I must quit but a nice addition would be to make \footlineextra overlay-specification aware.


Adding an alternative that doesn't use the footline template. This is in response to the comment on my previous answer. (Requires \usepackage{tikz})

\newcommand{\footlineextra}[1]{
    \begin{tikzpicture}[remember picture,overlay]
        \node[yshift=2ex,anchor=south west] at (current page.south west) {\usebeamerfont{author in head/foot}\hspace{2ex}#1};
    \end{tikzpicture}
}