# Way to see the invisible formatting in the clipboard and/or create the formatting when piping to pbcopy

copy/pasteformattingscriptterminal

Is there a way to see the contents of my clipboard in a way that shows me what formatting metadata is included?

Or to get to the question behind the question: is there a way to generate output in a script so that if I pipe the output to pbcopy it will include the formatting?

Specific example: if I write a script that generates a newline-delimited list of names, and then paste it into a table in Confluence, it will just dump the results into a single cell. I'd like to be able to paste it so that the whole column is filled up (with one name per cell).

I can do this by pasting the results into a Google Spreadsheet and then re-copying the column from Google Spreadsheet. For some reason that adds invisible formatting that allows me to paste the cells into Confluence, but when I inspect the clipboard (in Finder's Edit->Show Clipboard, or using pbpaste | hexdump) it seems exactly the same as the output of my script. I've often had this problem with formatting text for the clipboard, and I'd really like to know what tricks there are for viewing and generating this magical invisible formatting.