We can use the fact that authblk saves the list of authors and affiliations in a well defined format: in the case of the example, the macro \AB@authors expands to
\protect \Authfont \protect \AB@setsep First Author\protect \\[\affilsep ]%
\protect \Affilfont Affiliation of the 1st author\protect \and \protect
\Authfont \protect \AB@setsep Second Author\protect \\[\affilsep ]%
\protect \Affilfont Affiliation of the 2nd author.
(reformatted for clarity).
So we can use a recursive macro for extracting the data between \AB@setsep and \protect.
\documentclass{scrartcl}
\usepackage{fontspec, polyglossia}
\usepackage{authblk}
\setmainlanguage{english}
\setmainfont{CMU Serif}
\setsansfont{CMU Sans Serif}
\setmonofont{CMU Typewriter Text}
\makeatletter
\newwrite\titleauthorfile
\newcommand\writedatatofile{%
\immediate\openout\titleauthorfile=\jobname-titleauthors.dat
\immediate\write\titleauthorfile{\@title}%
\processauthors
\immediate\closeout\titleauthorfile
}
\newcommand\processauthors{%
\expandafter\process@authors\AB@authors\AB@setsep\protect\@nil
}
\def\process@authors#1\AB@setsep#2\protect#3\@nil{%
\ifx\relax#2\relax
\expandafter\@gobble
\else
\immediate\write\titleauthorfile{\unexpanded{#2}}%
\expandafter\@firstofone
\fi
{\process@authors#3\@nil}%
}
\makeatother
\author[1]{First Author}
\affil[1]{Affiliation of the 1st author}
\author[2]{Second Author}
\affil[2]{Affiliation of the 2nd author}
\title{Title of the article}
\begin{document}
\writedatatofile
\end{document}
The contents of the file \jobname-titleauthors.dat (\jobname is the name of the main file, it's better to use a name depending on it) will be
Title of the article
First Author
Second Author
For successive reading of the created file it's better to add some structure:
\documentclass{scrartcl}
\usepackage{fontspec, polyglossia}
\usepackage{authblk}
\setmainlanguage{english}
\setmainfont{CMU Serif}
\setsansfont{CMU Sans Serif}
\setmonofont{CMU Typewriter Text}
\makeatletter
\newwrite\titleauthorfile
\newcommand\writedatatofile{%
\immediate\openout\titleauthorfile=\jobname-titleauthors.dat
\immediate\write\titleauthorfile{%
\string\thispapertitle{\unexpanded\expandafter{\@title}}}%
\processauthors
\immediate\write\titleauthorfile{\string\finishauthors}
\immediate\closeout\titleauthorfile
}
\newcommand\processauthors{%
\expandafter\process@authors\AB@authors\AB@setsep\protect\@nil
}
\def\process@authors#1\AB@setsep#2\protect#3\@nil{%
\ifx\relax#2\relax
\expandafter\@gobble
\else
\immediate\write\titleauthorfile{%
\string\thispaperauthor{\unexpanded{#2}}%
}
\expandafter\@firstofone
\fi
{\process@authors#3\@nil}%
}
\makeatother
\author[1]{First Author}
\affil[1]{Affiliation of the 1st author}
\author[2]{Second Author}
\affil[2]{Affiliation of the 2nd author}
\title{Title of the article}
\begin{document}
\writedatatofile
\end{document}
Now the output file would be
\thispapertitle{Title of the article}
\thispaperauthor{First Author}
\thispaperauthor{Second Author}
\finishauthors
And you can \input this file after giving sensible definitions for \thispapertitle and \thispaperauthor.