Generate a TXT file to hard drive from game

Hey guys , im wondering is there a way to create a .txt file to my hard drive while in game?

Im trying to select objects, and then write the MESH name in a document to use it later in other software.

Do you know how to achieve this ?