Copy Selected Document as a table from a view

Hello

During the script, I have handle on the mail documents that meet the criteria in the inbox folder. I would like to paste certain fields from these selected mail documents to another documents as a table.

Is there any way, @formula or method so I can copy Subject, From and doc link fields from these selected docs as a table in to another document just like you would do “Copy Selected as Table” from the Edit menu. Basically I want to perform the “Copy Selected as Table” feature from the script.

Thanks,