Hi Gianmaria,
If you do this you can write to a file in the filesystem:
{
\displayLilyMusic #(open-output-file "display.txt") { c'4\f }
}
There's information about displayMusic in Section 1.3.1 Displaying Music Expressions in the section of the manual on extending. Works fine for displayLilyMusic too. Just tried it now.
I suppose you were asking about Frescobaldi, but you can put this in your score.
Andrew