I apologize in advance as I am yet to accept some answers to my previous questions; but I'll dare ask this one, as it is somewhat of a showstopper - consider this example:
\documentclass{article}
\usepackage[fixpdftex,cmyk,svgnames]{xcolor}
\usepackage[breaklinks]{hyperref}
\newcommand{\myauthors}{Author 1 \\ Author 2 \\ {\color{lightgray}Author 3}}
\hypersetup{pdftitle=My Title, pdfauthor=\myauthors, pdfsubject=My Subject, pdfkeywords=}
\begin{document}
\noindent\myauthors
\end{document}
Here I get the \myauthors typeset exactly as I want them (the "Author 3" is lightgray) - however, in the PDF properties, the Author metadata shows: "Author 1 Author 2 lightgrayAuthor 3" - that is, the "lightgray" in \color{lightgray} of \myauthors ends up as text for the pdfauthor attribute.
I was wandering - is there some sort of a macro, that would "extract" the typeset "plain text" (that is, only those characters that are typeset) - so I could write, say:
\hypersetup{... pdfauthor=\getPlainText{\myauthors}, pdfsubject=...}
... and get "Author 1 Author 2 Author 3" as PDF author metadata?
Alternatively, I was thinking something along the approach in Macro to convert 'multi-line' text to 'single-line' (remove line breaks?) - that is, use macros like:
\def\pastauth#1{\color{lightgray}#1}
\def\npastauth#1{#1}
\newcommand{\myauthors}{Author 1 \\ Author 2 \\ \pastauth{Author 3}}
... and then somehow define a \getPlainText, where the \pastauth would be temporarily \let to \npastauth (thus avoiding \color{lightgray} altogether) - but I cannot get anything with this... I also tried redefining \color with \@gobbleone, but that doesn't work either

:)). – doncherry Apr 06 '12 at 09:56:)Cheers! – sdaau Apr 06 '12 at 10:19