Data formats used in textClipping, webloc and mailloc files 1994-2025

Last week, I explained how the three clipping services, textClipping, webloc and mailloc, work in modern macOS. This article provides a summary of the file formats used by each, from Mac OS 9 (and presumably when they were first introduced in System 7.5) to macOS 26.2.

Resource forks or com.apple.ResourceFork xattrs

The key resource is a ‘drag’ with a number of 128. This contains a table of contents, giving the OSType and number of each resource in the clipping. For example, the entry
$"7574 7874 0000 0100 0000 0000 0000 0000"
is that for a ‘utxt’ resource number 256.

A minimal Resource fork might thus consist of the ‘drag’ table and a single ‘TEXT’ resource containing its text:
'drag' (128) {
$"0000 0001 0000 0004 0000 0000 0000 0002"
$"5445 5854 0000 0100 0000 0000 0000 0000"
};
'TEXT' (256) {
$"7468 6520 6D61 7472 6978 2062 6C72 200D"
};

Data types supported in textClippings include the following resources:

  • ‘TEXT’, containing text content in Classic Mac format
  • ‘utf8’, UTF-8 text content
  • ‘ut16’, UTF-16 text content, with a byte-order mark prefacing the text
  • ‘utxt’, UTF-16 text content, without a byte-order mark
  • ‘styl’, text styling to be applied the contents of ‘TEXT’
  • ‘HTML’, HTML content
  • ‘RTF ‘, RTF content
  • ‘weba’, a WebArchive binary property list
  • ‘url ‘, URL content (webloc, mailloc)

Also encountered are ‘icns’ containing a custom icon to be used for the textClipping, and ‘kwst’ whose function escapes me.

Weblocs and maillocs are much simpler, and only contain a ‘drag’ table of contents, and the URL given as strings in both ‘TEXT’ and ‘url ‘ resources.

Although there have been bugs that could have affected the generation of com.apple.ResourceFork xattrs, in general these have been used since the introduction of clipping formats last century, and continue to be created today.

Data formats

These were introduced in about 2015, as an addition to the com.apple.ResourceFork extended attribute. They are binary property lists (bplist), and when represented in text form they consist of a single dictionary, in textClippings with the key UTI-Data, containing a single dictionary of data types with keys named from the UTI of each data type. Those can include the following as binary data:

  • com.apple.traditional-mac-plain-text = ‘TEXT’
  • public.utf16-plain-text = ‘utxt’
  • public.utf16-external-plain-text = ‘ut16’
  • com.apple.webarchive = ‘weba’
  • public.html = ‘HTML’

The following are given as strings:

  • public.utf8-plain-text = ‘utf8’
  • public.rtf = ‘RTF ‘

Older versions of the bplist could also contain an OSType-Data dictionary containing style and ustl key-value pairs, but those appear to have died out since macOS Mojave.

With this format, there’s no need for a table of contents equivalent to the ‘drag’ resource. Styled text is now only represented as RTF, and there doesn’t appear to be any use of attributed strings as a data type.

Once again, weblocs and maillocs are far simpler, and contain a single dictionary with the key URL, with a value containing the URL given as a string.

Known bugs

Firefox has used an inetloc file similar in content, and in Mojave this caused problems when trying to open them.

Safari 12.1.1 in macOS 10.14.4-10.14.6 produced malformed data in the weblocs it saved. macOS Ventura 13.2 fixed a bug that could result in weblocs being opened by a browser other than the default.

Other clipping file types

These have been popular in the past, but are seldom encountered now, and include a pictClipping containing a PICT QuickDraw image and its TIFF equivalent, both in the com.apple.ResourceFork xattr and in the file data.

Summary

The table below summaries the different representations of data types seen in clippings.