TextExpander, Butler, TypeIt4Me, Typinator, Keyboard Maestro, pasteboard history applications, and other applications briefly commandeer Mac OS X’s general pasteboard to transport large chunks of data into the user’s current context quickly. Often, shortly after this data is inserted, the pasteboard is returned to its previous contents. These applications need a way to identify their data as being temporary, different than content Copied by the user, and/or otherwise special – additional pasteboard types offer a solution.
Additionally, password utilities such as 1Password might mark passwords or other sensitive data, either placed programmatically or user-Copied to the pasteboard, so that pasteboard history utilities could obfuscate passwords when displayed on screen (to avoid inadvertently revealing your password to a “shoulder surfer”), and/or avoid writing them as plain text to a pasteboard history file.
Pasteboard history utilities may also choose to treat content identified as not explicitly Copied by the user differently, either by excluding it, or by presenting it differently
Identify and respect currently-defined transient and not-user-Copied pasteboard data identifiers.
Define new, shared transient, not-user-Copied, and confidential pasteboard data identifiers to use and respect in the future.
Known ‘proprietary’ pasteboard marker types identifying the pasteboard content as “transient”:
@"Pasteboard generator type"
Known ‘proprietary’ pasteboard marker types identifying the pasteboard content as confidential:
Please send other existing identifiers to: firstname.lastname@example.org, and we’ll add them to this list.
To avoid a proliferation of marker types from a variety of developers, use these universal identifiers:
org.nspasteboard.TransientType: This marker’s presence indicates content will be on the pasteboard only momentarily. The pasteboard will either be restored to previous content, or the current content will be replaced within seconds. Data marked transient should not be recorded or displayed in a pasteboard history.
org.nspasteboard.ConcealedType: This marker’s presence indicates content that should be treated as confidential. If displayed on screen it should be visually obfuscated. Avoid recording it to a file, or consider encrypting it.
org.nspasteboard.AutoGeneratedType: This marker’s presence indicates content was generated by an application; the user had no intention to Copy this content and may not expect to find it on the pasteboard. (This marker is often found with a TransientType marker as well.) Data marked this way probably should not be recorded as part of the pasteboard history, but (if not also marked transient) might need to be displayed as the “current” pasteboard content.
org.nspasteboard.source: This marker’s presence indicates that the source of the content is the application with the bundle identifier matching its UTF-8 string content. For example:
[pasteboard setString: @"org.nspasteboard.SampleApp" forType: @"org.nspasteboard.source"];This is useful when the source is not the foreground application. This is meant to be shown to the user by a supporting app for informational purposes only.
org.nspasteboard.TransientTypetype with a payload of your choice to a pasteboard that will be replaced or restored shortly after it is placed on the pasteboard. For example:
[generalPasteboard setData: [NSData data] forType: @"org.nspasteboard.TransientType"];
If you are writing a new application in this area, please don’t create new identifiers for generated or transient data. If you feel some other type of marker is needed for your software’s needs, join the discussion as mentioned below and propose it there.
If your software shows a history of the pasteboard contents, displays the current pasteboard contents, or otherwise manipulates or responds to changes in the general pasteboard:
Pasteboard generator type, and
These pasteboard marker types and proposals for others are discussed on a Google Group discussion list. To request an invitation to the group, send an email to email@example.com with subject: NSPasteboard.org.
org.nspasteboard.source; removed PTH Pasteboard, as it is no longer available.
Hosted by Smile