Options
All
  • Public
  • Public/Protected
  • All
Menu

Input defines properties to access the input text contents.

Hierarchy

  • Input

Index

Properties

Unprocessed selection contents indexed by UTI.

data: { emails: RangedStrings; nonHttpUrls: RangedStrings; paths: RangedStrings; urls: RangedStrings }

Data of various kinds, that PopClip detected in the selected text.

Type declaration

  • emails: RangedStrings

    Email addresses.

  • nonHttpUrls: RangedStrings

    Other protocols or app urls e.g. ftp:, omnifocus:, craftdocs: etc. (PopClip has a pre-defined allowlist for custom URL schemes.)

  • paths: RangedStrings

    Local file paths.

  • urls: RangedStrings

    HTTP ot HTTPS urls.

html: string

HTML content (if captureHtml is true).

markdown: string

Markdown content (if captureHtml is true).

matchedText: string

If the action specified requirements or a regex to match the input, this will be the matching part of the text. Otherwise, it will be the same string as text.

regexResult?: any

If the action specified a regex to match the input, this will be the full result of the the match.

You can use this to access any capture groups from the regex. The value is a return value from JavaScript's RegExp.prototype.exec() method.

Example

// text: "apple", regex: /.(.)/
selection.regexResult[0] // "ap" (full match)
selection.regexResult[1] // "p" (capture group 1)
rtf: string

RTF content (if captureRtf is true).

text: string

The plain text selected by the user. If there is no selected text, this will be the empty string.

xhtml: string

XHTML content (if captureHtml is true).

Generated using TypeDoc