What happens when you paste an app into TextEdit?

In the past, I have pasted apps into TextEdit, which would show something like the following. I always thought that this was a convenient way to store app icons (as .icns files), in case I ever wanted to back a list of my apps up (just the names/icons, not the apps themselves) to manually download and install later.

I recently tried pasting about 20 apps into a TextEdit document, and the document turned out to be about 3GB large. This definitely is much larger than the .icns files for 20 apps. What exactly is stored in this TextEdit document?

enter image description here


When pasting an application into TextEdit as an RTF document and saved as Rich Text Document with Attachments it creates a Rich Text document bundle, e.g. Untitled.rtfd and will contain a copy of the application pasted into the document.

The more apps you paste into the document the larger it will be.

You can check the contents of the e.g. Untitled.rtfd document bundle by selecting it in Finder and right-click then select Show Package Contents.

There you will see a copy of each application bundle you've pasted into the Rich Text Document that was saved as Rich Text Document with Attachments.


Apple’s copy / paste mechanism contains multitudes.

When you copy something - many levels of data are stored into the pasteboard object - literally a reference to these apps is available to any application that receives a paste command.

You can start on understanding this rich and complicated behavior with two items:

  1. An excellent app to show you what’s really on the pasteboard
  2. An excellent write up on how this all works.

For #1 I recommend the pasteboard viewer - https://sindresorhus.com/pasteboard-viewer - it’s on the MacApp Store and also source code is available under the MIT license.

For #2 I recommend the writings of Howard Oakley - his dives to the depths of the code and implementation yet writes clearly and in accessible terms. https://eclecticlight.co/2020/05/12/cut-copy-paste-inside-the-pasteboard-clipboard/

When you paste an item from the clipboard, its data are passed to the requesting app, which then performs any conversion necessary, and inserts it in the document.


So to answer your question, it’s possible you have all of the various resolution of the icon images pasted into your document, but I would need to examine either your document or your exact pasteboard contents prior to pasting to answer your question. Hopefully the general answer above helps everyone as well as you dig into specifics.

RTFD documents are plain text with attachments, so you can examine them in the command line or control click to show package contents just like other folders in Finder.