How do I make an attached non-pdf file display like a link?

I'm embedding an external file in my pdf with \usepackage{attachfile2} and \textattachfile[color=1 1 1]{description}{file.txt}. How can I make the text look the same as it would if I had used the hyperref package and done something like

\label{here}%
\rlap{\hyperref{here}{\phantom{description}}}%
\textattachfile[color=0 0 0]{description}{file.txt}


?

I'm looking for something that includes the non-printing border, but only opens the file when clicked. I suppose I'd be ok with some hacky code that modifies the internals of hyperref or attachfile2. (I haven't figured out myself how to redefine \Hy@StartlinkName to use, e.g., user instead of goto link, because I don't know what /A and /Subtype to pass to user. I also haven't figured out how to modify the internals of attachfile2 to behave more like hyperref.)

Note: the solution to my previous question only works for embedded pdf files.

You can create a link to an embedded file using the JavaScript function exportDataObject. The following code creates a new command \embeddedfilelink{<file>}{<text>} that creates a link to an embedded file specified by its file name with the given link text. The code is taken from hypgotoe and modified to create a JavaScript action instead of a GoToE action.

\documentclass{article}

\usepackage{embedfile}
\usepackage{hyperref}

% How do I make an attached non-pdf file display like a link?
% (http://tex.stackexchange.com/q/230581)
\makeatletter
\begingroup
\leavevmode
attr{%
\Hy@setpdfborder
\ifx\@pdfhighlight\@empty
\else
/H\@pdfhighlight
\fi
\ifx\@filebordercolor\relax
\else
/C[\@filebordercolor]%
\fi
}%
user{%
/A<<%
/Type/Action%
/S/JavaScript%
/JS(this.exportDataObject({cName: "#1", nLaunch: 2}))%
>>%
}%
\relax
\endgroup
}
\makeatother

\embedfile{file.txt}

\begin{document}

• Gives me the error: Package xcolor Error: Undefined color '0 .5 .5' – fars Jun 8 '19 at 1:09