Create a new RichString object from a string.
-The string to convert to a RichString object.
-Optional
options: { Options for the conversion.
-Optional
format?: "rtf" | "html" | "markdown"Format of the source string. Default is 'rtf'.
-Readonly
htmlAn HTML representation of the content.
-Readonly
rtfAn RTF representation of the content.
-Generated using TypeDoc
This global function may be called as an alternative to setting module.exports
directly.
-The advantage of using defineExtension()
is that you will automatically get type checking
-and autocomplete for your extension object.
You may define the shape of the extensions's options object by specifying the
-CustomOptions
generic type parameter. This will enable type checking and autocomplete for
-the options
parameter in action functions and the population function.
The extension object to export.
-Generated using TypeDoc
Output a string for debugging purposes. By default it is not output anywhere, but -you can configure PopClip to output to the Console app by running the following command in Terminal:
-defaults write com.pilotmoon.popclip EnableExtensionDebug -bool YES
then Quit and restart PopClip.
-print("Hello, world!")
// print: Hello, world!
print(1, Math.PI, 2/3, ['a','b','c'])
// print: 1 3.141592653589793 0.6666666666666666 a,b,c
-
-Rest
...args: any[]Generated using TypeDoc
Import an object from another file.
-PopClip's require()
implementation attempts to import from the following module formats:
define(...)
.module.exports = ...
or exports.name = ...
exports.default = ...
Paths beginning with ./
or ../
are resolved relative to the the location of the current file.
Otherwise, the path is resolved relative to the extensions's package root. -If there is no file in the extension, PopClip will look in its internal module repository.
-If no file extension is given, PopCLip will try adding the extensions .js
, .ts
, .json
in that order.
TypeScript files are transpiled to JavaScript on the fly.
-JSON files are parsed and returned as an object.å
-Path to the file to import.
-The imported object.
- -Generated using TypeDoc
A promise-based sleep function. Included as a more convenient alternative
-to [[setTimeout]] for performing simple delays. Call as await sleep(1000)
.
How long to sleep in milliseconds
-Generated using TypeDoc
This documentation describes the API available to PopClip's JavaScript actions and module-based extensions.
-It is auto-generated from the TypeScript definitions file, popclip.d.ts.
-A good starting point is the PopClip object.
-Generated using TypeDoc
Action represents the properties of a single action.
-If code
is omitted, the action displays a disabled title/icon only.
Optional
afterAn optional step to peform after the main action.
-Optional
appDeclares the application or website associated with this action, if any.
-Optional
beforeAn optional step to peform before the main action.
-Optional
captureWhether PopClip will capture HTML and Markdown content for the selection. Default is no.
-Optional
captureWhether PopClip will capture RTF (Rich Text Format) content for the selection. Default is no.
-Optional
circleDraw the icon inside a circle.
-Optional
excludedArray of bundle identifiers for which the extension should not appear. The action will not -appear if PopClip is used in any of the specified apps.
-This property has no effect on dynamically generated actions.
-Optional
filledDraw the enclosing shape as a solid shape.
-Optional
flipXIf true, the supplied icon will be drawn horizontally flipped. Default is false.
-Optional
flipYIf true, the supplied icon will be drawn vertically flipped. Default is false.
-Optional
iconA string to define the action's icon.
-If no icon is defined here, the extension's icon will be used, if any.
-Setting to null
explicitly sets the action to have no icon.
Optional
identifierA unique identifying string. An identifier for an action can be any string of your choosing.
-Optional
monospacedFor text icons only. Draw the text using a monospaced font.
-Optional
moveXMove the icon horizontally by the specified distance, expressed as percentage of the icon's width.
-Optional
moveYMove the icon vertically by the specified distance, expressed as percentage of the icon's height.
-Optional
preserveIf true, the supplied icon will be displayed with its original aspect ratio instead of being scaled to fit a square. Default is false.
-Optional
preserveIf true, the supplied icon will be displayed with its original color instead of being filled in white/black. Default is false.
-Optional
regexA regular expression to decide whether this action appears in the popup.
-You may express the value either as a
-JavaScript regular expression literal
-(or otherwise constructed RegExp
object), or as a string.
RegExp
it will be evaluated in the JavaScript engine.NSRegularExpression
API (same as for 'classic' PopClip extensions).If the regex matches the selected text, the action will be shown in the popup and -the first occurrence of the matched text is accessible later via matchedText.
-If there is no match, the action is excluded from the popup.
-The regex's lastIndex
is reset before and after each invocation, so the g
(global) and y
(sticky) flags have no effect.
This property has no effect on dynamically generated actions.
-regex = /abc/i // Example regex 'abc' with 'i' (case insensitive) flag
// Matches abc, ABC, Abc, etc.
-
-Optional
requiredArray of bundle identifiers for which the extension should appear. The action will only -appear if PopCLip is used in one of the specified apps.
-This property has no effect on dynamically generated actions.
-Optional
requirementsAn array of conditions which must be met for this action to appear — see [[Requirement]].
-["text"]
.When multiple conditions are specified, all of them must be satisfied.
-An empty array ([]
) indicates no requirements at all, meaning the action will always appear.
This property has no effect on dynamically generated actions.
-Optional
restoreWhether the pasteboard should be restored to its original state after paste-result
.
Optional
rotateRotate the icon anticlockwise by the specified angle, expressed in degrees.
-Optional
scaleScale the icon by the specified factor, expressed as a percentage of the original size.
-Optional
searchDraw the icon inside a magnifying glass shape.
-Optional
squareDraw the icon inside a square.
-Optional
stayWhether PopClip's popup should stay on screen after clicking this action's button. Default is no.
-Optional
strikeDraw a strike-through line over the icon.
-Optional
titleThe action's title.
-If no title is defined here, the extension's [`[name]] will be used, if any.
-Generated using TypeDoc
Properties common to Action and Extension
-Optional
afterAn optional step to peform after the main action.
-Optional
appDeclares the application or website associated with this action, if any.
-Optional
beforeAn optional step to peform before the main action.
-Optional
captureWhether PopClip will capture HTML and Markdown content for the selection. Default is no.
-Optional
captureWhether PopClip will capture RTF (Rich Text Format) content for the selection. Default is no.
-Optional
circleDraw the icon inside a circle.
-Optional
excludedArray of bundle identifiers for which the extension should not appear. The action will not -appear if PopClip is used in any of the specified apps.
-This property has no effect on dynamically generated actions.
-Optional
filledDraw the enclosing shape as a solid shape.
-Optional
flipXIf true, the supplied icon will be drawn horizontally flipped. Default is false.
-Optional
flipYIf true, the supplied icon will be drawn vertically flipped. Default is false.
-Optional
iconA string to define the action's icon.
-If no icon is defined here, the extension's icon will be used, if any.
-Setting to null
explicitly sets the action to have no icon.
Optional
identifierA unique identifying string. An identifier for an action can be any string of your choosing.
-Optional
monospacedFor text icons only. Draw the text using a monospaced font.
-Optional
moveXMove the icon horizontally by the specified distance, expressed as percentage of the icon's width.
-Optional
moveYMove the icon vertically by the specified distance, expressed as percentage of the icon's height.
-Optional
preserveIf true, the supplied icon will be displayed with its original aspect ratio instead of being scaled to fit a square. Default is false.
-Optional
preserveIf true, the supplied icon will be displayed with its original color instead of being filled in white/black. Default is false.
-Optional
regexA regular expression to decide whether this action appears in the popup.
-You may express the value either as a
-JavaScript regular expression literal
-(or otherwise constructed RegExp
object), or as a string.
RegExp
it will be evaluated in the JavaScript engine.NSRegularExpression
API (same as for 'classic' PopClip extensions).If the regex matches the selected text, the action will be shown in the popup and -the first occurrence of the matched text is accessible later via matchedText.
-If there is no match, the action is excluded from the popup.
-The regex's lastIndex
is reset before and after each invocation, so the g
(global) and y
(sticky) flags have no effect.
This property has no effect on dynamically generated actions.
-regex = /abc/i // Example regex 'abc' with 'i' (case insensitive) flag
// Matches abc, ABC, Abc, etc.
-
-Optional
requiredArray of bundle identifiers for which the extension should appear. The action will only -appear if PopCLip is used in one of the specified apps.
-This property has no effect on dynamically generated actions.
-Optional
requirementsAn array of conditions which must be met for this action to appear — see [[Requirement]].
-["text"]
.When multiple conditions are specified, all of them must be satisfied.
-An empty array ([]
) indicates no requirements at all, meaning the action will always appear.
This property has no effect on dynamically generated actions.
-Optional
restoreWhether the pasteboard should be restored to its original state after paste-result
.
Optional
rotateRotate the icon anticlockwise by the specified angle, expressed in degrees.
-Optional
scaleScale the icon by the specified factor, expressed as a percentage of the original size.
-Optional
searchDraw the icon inside a magnifying glass shape.
-Optional
squareDraw the icon inside a square.
-Optional
stayWhether PopClip's popup should stay on screen after clicking this action's button. Default is no.
-Optional
strikeDraw a strike-through line over the icon.
-Optional
titleThe action's title.
-If no title is defined here, the extension's [`[name]] will be used, if any.
-Generated using TypeDoc
Declares information about an app or website that this extension interacts with.
-Optional
bundleList of possible bundle identifiers of this app.
-Optional
checkIndicates whether PopClip should check for the presence of the app on the computer. Default is false.
-Web page where user can obtain the app, e.g. "https://www.literatureandlatte.com/scrivener".
-Name of the app. For example "Scrivener"
-Generated using TypeDoc
Credentials used in auth function
-Extension identifier
-Extension display name
-Value of password
option (will be empty string if none defined)
An appropriate value to use as the redirection URL in authorization flows for this extension.
-Example output:
-http://localhost:58906/callback/com.pilotmoon.popclip.extension.todoist/auth
Value of username
option (will be empty string if none defined)
Generated using TypeDoc
The authsecret
property has the special behaviour of throwing an Error
with the message 'Not signed in' if it is accessed while either
-undefined or holding an empty string.
The stored value that was returned from the auth()
function.
Generated using TypeDoc
Properties relating the context surrounding the selected text.
-The bundle identitifier of the current app, for example com.agiletortoise.Drafts-OSX
.
The name of the current app, for example Drafts
.
If the current app is a compatible browser, this will be the page title.
-If the current app is a compatible browser, this will be the page URL.
-This property is true iff text was selected.
-This property is true iff text was selected and the app's Cut command is enabled.
-This property is true iff the Paste command is enabled in the current app.
-Indicates whether the text area supports formatting.
-Generated using TypeDoc
The Extension object defines the PopClip extension.
-Optional
actionSimplified property to define a single action.
-Optional
actionsDefine the actions to go in PopClip's popup. This can be an array or a function.
-If it's an array, the supplied actions are used in the popup, subject to meeting the -requirements and regex conditions.
-If it's a population function, it is called by PopClip to dynamically populate the popup with actions from this extension.
-Setting requirements and regex keys has no effect on dynamic actions — the function itself is responsible for deciding what actions to show.
-Population function requires the dynamic
entitlement.
Optional
afterAn optional step to peform after the main action.
-Optional
appDeclares the application or website associated with this action, if any.
-Optional
authIf you define this function then PopClip will display a 'sign in' button in the options UI. When the user clicks the button,
-PopClip will call this function with an info
object and an flow
callback.
If the sign in needs a username and password, you'll also need to define username
and password
options. PopClip will then pass the values
-of those options in the info parameter.
Optional
beforeAn optional step to peform before the main action.
-Optional
captureWhether PopClip will capture HTML and Markdown content for the selection. Default is no.
-Optional
captureWhether PopClip will capture RTF (Rich Text Format) content for the selection. Default is no.
-Optional
circleDraw the icon inside a circle.
-Optional
excludedArray of bundle identifiers for which the extension should not appear. The action will not -appear if PopClip is used in any of the specified apps.
-This property has no effect on dynamically generated actions.
-Optional
filledDraw the enclosing shape as a solid shape.
-Optional
flipXIf true, the supplied icon will be drawn horizontally flipped. Default is false.
-Optional
flipYIf true, the supplied icon will be drawn vertically flipped. Default is false.
-Optional
iconA string to define the action's icon.
-If no icon is defined here, the extension's icon will be used, if any.
-Setting to null
explicitly sets the action to have no icon.
Optional
identifierA unique identifying string. An identifier for an action can be any string of your choosing.
-Optional
monospacedFor text icons only. Draw the text using a monospaced font.
-Optional
moveXMove the icon horizontally by the specified distance, expressed as percentage of the icon's width.
-Optional
moveYMove the icon vertically by the specified distance, expressed as percentage of the icon's height.
-Optional
nameThe display name of this extension.
-Optional
optionsDefines the user-configurable options for this extension.
-Optional
preserveIf true, the supplied icon will be displayed with its original aspect ratio instead of being scaled to fit a square. Default is false.
-Optional
preserveIf true, the supplied icon will be displayed with its original color instead of being filled in white/black. Default is false.
-Optional
regexA regular expression to decide whether this action appears in the popup.
-You may express the value either as a
-JavaScript regular expression literal
-(or otherwise constructed RegExp
object), or as a string.
RegExp
it will be evaluated in the JavaScript engine.NSRegularExpression
API (same as for 'classic' PopClip extensions).If the regex matches the selected text, the action will be shown in the popup and -the first occurrence of the matched text is accessible later via matchedText.
-If there is no match, the action is excluded from the popup.
-The regex's lastIndex
is reset before and after each invocation, so the g
(global) and y
(sticky) flags have no effect.
This property has no effect on dynamically generated actions.
-regex = /abc/i // Example regex 'abc' with 'i' (case insensitive) flag
// Matches abc, ABC, Abc, etc.
-
-Optional
requiredArray of bundle identifiers for which the extension should appear. The action will only -appear if PopCLip is used in one of the specified apps.
-This property has no effect on dynamically generated actions.
-Optional
requirementsAn array of conditions which must be met for this action to appear — see [[Requirement]].
-["text"]
.When multiple conditions are specified, all of them must be satisfied.
-An empty array ([]
) indicates no requirements at all, meaning the action will always appear.
This property has no effect on dynamically generated actions.
-Optional
restoreWhether the pasteboard should be restored to its original state after paste-result
.
Optional
rotateRotate the icon anticlockwise by the specified angle, expressed in degrees.
-Optional
scaleScale the icon by the specified factor, expressed as a percentage of the original size.
-Optional
searchDraw the icon inside a magnifying glass shape.
-Optional
squareDraw the icon inside a square.
-Optional
stayWhether PopClip's popup should stay on screen after clicking this action's button. Default is no.
-Optional
strikeDraw a strike-through line over the icon.
-Optional
titleThe action's title.
-If no title is defined here, the extension's [`[name]] will be used, if any.
-Generated using TypeDoc
Properties that define how an icon is interpreted.
-Optional
circleDraw the icon inside a circle.
-Optional
filledDraw the enclosing shape as a solid shape.
-Optional
flipXIf true, the supplied icon will be drawn horizontally flipped. Default is false.
-Optional
flipYIf true, the supplied icon will be drawn vertically flipped. Default is false.
-Optional
monospacedFor text icons only. Draw the text using a monospaced font.
-Optional
moveXMove the icon horizontally by the specified distance, expressed as percentage of the icon's width.
-Optional
moveYMove the icon vertically by the specified distance, expressed as percentage of the icon's height.
-Optional
preserveIf true, the supplied icon will be displayed with its original aspect ratio instead of being scaled to fit a square. Default is false.
-Optional
preserveIf true, the supplied icon will be displayed with its original color instead of being filled in white/black. Default is false.
-Optional
rotateRotate the icon anticlockwise by the specified angle, expressed in degrees.
-Optional
scaleScale the icon by the specified factor, expressed as a percentage of the original size.
-Optional
searchDraw the icon inside a magnifying glass shape.
-Optional
squareDraw the icon inside a square.
-Optional
strikeDraw a strike-through line over the icon.
-Generated using TypeDoc
Input defines properties to access the input text contents.
-Unprocessed selection contents indexed by UTI.
-Data of various kinds, that PopClip detected in the selected text.
-Email addresses.
-Other protocols or app urls e.g. ftp:
, omnifocus:
, craftdocs:
etc. (PopClip has a pre-defined allowlist
-for custom URL schemes.)
Local file paths.
-HTTP ot HTTPS urls.
-HTML content (if captureHtml
is true).
Indicate if the text content is just a web URL (or URL-like string
-such as popclip.app
), allowing for leading and trailing whitespace.
Markdown content (if captureHtml
is true).
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]].
-Optional
regexIf the action specified a regex to match the input, this will be the result of the the match.
-You can use this to access any capture groups from the regex.
-If the regex was specified as a JavaScript regex, the value is a return value from JavaScript's -RegExp.prototype.exec() method.
-If the regex was specified as an ICU regex in the static config, the value is the array of capture components.
-// text: "apple", regex: /.(.)/
selection.regexResult[0] // "ap" (full match)
selection.regexResult[1] // "p" (capture group 1)
-
-RTF content (if captureRtf
is true).
The plain text selected by the user. If there is no selected text, this will be the empty string.
-XHTML content (if captureHtml
is true).
Generated using TypeDoc
Represents the state of the four modifier keys. The value is true when the key is held down -at the time the action is invoked. -See PopClip.modifiers.
-Command (⌘) key state.
-Control (⌃) key state.
-Option (⌥) key state.
-Shift (⇧) key state.
-Generated using TypeDoc
Defines a single extension option.
-Optional
defaultThe default value of the option. If ommitted, string
options default to the empty string,
-boolean
options default to true, and multiple
options default to the top item in the list.
-A password
field may not have a default value.
Optional
descriptionAn optional longer explanantion of this option, to be shown in the UI.
-Optional
iconAn icon for this option. It is only displayed for boolean options, next to the check box.
-An identifying string for this option.
-Optional
labelA short label for this option.
-The kind of option, one of:
-string
: a text box for free text entry,boolean
: a check box,multiple
: multiple-choice drop-down with predefined options,secret
: concealed text entry field (persisted in user's keychain),password
: concealed text entry field (not persisted, only passed to auth function),heading
: adds a heading in the user interface, but does not actually define an optionOptional
valueDisplay names corresponding to the entries in the [[values]] array. These are shown in the option UI. -If ommitted, the raw value strings are shown instead.
-Optional
valuesThe possible values for a multiple
option.
Generated using TypeDoc
Represents the current values of the extension's settings.
-Generated using TypeDoc
Options for Paste operations.
-Optional
restoreWhether to restore the original contents of the pasteboard after the paste
-operation. Default is false
.
Generated using TypeDoc
A simplified interface to the macOS pasteboard. Implemented by the global object, [[pasteboard
]].
Get and set the content of the pasteboard, of the specified types
-Get and set the plain text content of the pasteboard.
-This property corresponds with the pasteboard type public.utf8-plain-text
.
When placing text on the pasteboard this way, PopClip's "Copied" notification will not appear. -(Typically, scripts should use [[copyText]] instead, so that the user gets the "Copied" notification.)
-The value of this property will always be a string. If there is no plain text value on the
-pasteboard, reading this property will give an empty string (""
).
let x = pasteboard.text;
pasteboard.text = "new text";
-
-Generated using TypeDoc
Represents the raw pasteboard content, indexed by UTI. Supports string data only.
-Generated using TypeDoc
This interface describes the methods and properties of the global [[popclip
]] object.
Trigger PopClip to appear again with the current selection.
-Readonly
contextThe current context.
-Copy arbitrary pasteboard content.
-Places the given string on the pasteboard, and shows "Copied" notificaction to the user.
-The plain text string to copy
-Readonly
inputThe current selection.
-Readonly
modifiersThe state of the modifier keys when the action was invoked in PopClip.
-During the execution of the population function, all the modifiers will read as false.
-Open a URL in an application.
-If a target application bundle identifier is specified via the app
option, PopClip will ask that app to open the URL.
If no target app is specified:
-Any parameters etc. in the URL must be appropriately percent-encoded. JavaScript provides the -encodeURIComponent() -function for this.
-popclip.openUrl("https://xkcd.com"); // open xckd.com in current/default browser
popclip.openUrl("https://xkcd.com", {app: "com.brave.Browser"}); // open xkcd.com in Brave browser
popclip.openUrl(`mailto:support@pilotmoon.com?subject=${encodeURIComponent("What's up?")}`); // open mailto link in the default mail application
-
-A well-formed URL
-Optional
options: { Options.
-Optional
app?: stringBundle identifier of the app to open the URL with. For example "com.google.Chrome"
.
Readonly
optionsThe current values of the options.
-Paste arbitrary pasteboard content.
-Optional
options: PasteOptionsIf the target app's Paste command is available, this method places the given string on the pasteboard
-and then invokes the target app's Paste comand. If the restore
flag is set in the options, it will
-then restore the original pasteboard contents.
If the target app's Paste command is not available, it behaves as [[copyText]] instead.
-// place "Hello" on the clipboard and invoke Paste
popclip.pasteText("Hello");
// place "Hello", then restore the original pasteboard contents
popclip.pasteText("Hello", {restore: true});
-
-The plain text string to paste
-Optional
options: PasteOptionsInvokes a command in the target app.
-Either cut
, copy
or paste
.
Optional
options: { Options for the command.
-Optional
transform?: "none" | "plain"Transformation to apply to the pasteboard contents. (Default: none
)
none
: regular pasteboard operationplain
: strips away everything but plain textSimulate a key press by the user.
-// press the key combo ⌘B
popclip.pressKey('command B');
// press the key combo ⌥⌘H
popclip.pressKey('option command H');
// press the return key
popclip.pressKey('return');
popclip.pressKey(util.constant.KEY_RETURN); // equivalent
* // press option and the page down key
popclip.pressKey('option 0x79');
popclip.pressKey(0x79, util.constant.MODIFIER_OPTION); // equivalent
-
-Some key code and modifier constants are available in util.constant.
-The key to press. When this parameter is a string, PopClip will interpret it as in -Key Press actions. -When this parameter is a number, PopClip will use that exact key code.
-Optional
modifiers: numberAn optional bit mask specifiying additional modifier keys, if any.
-Share items with a named macOS sharing service.
-// share a string with the Messages service
popclip.share("com.apple.share.Messages.window", ["Hello, world!"]);
// share a URL with the Safari Reading List service
popclip.share("com.apple.share.System.add-to-safari-reading-list", [{ url: "https://example.com" }]);
// share a an html string with the Notes service
const item = new RichString("Some <b>simple</b> html", { format: html })
popclip.share("com.apple.Notes.SharingExtension", [item]);
-
-The list of available sharing services is determined by the user's system configuration.
-The name of the sharing service to use.
-An array of items to share. Each item can be a string, a RichString object, or an object with a url
property.
If the service name is not recognized, or if the service cannot handle the supplied items, an error is thrown.
-PopClip will show an "X" symbol to indicate failure.
-PopClip will open the settings UI for this extension.
-If the extension has no settings, this method does nothing.
-PopClip will show a checkmark symbol to indicate success.
-Display text inside PopClip's popup, with option to make the display a clickable button to -paste the text.
-The text to display. It will be truncated to 160 characters when shown.
-Optional
options: { Optional
preview?: booleanIf true
, and the app's Paste command is available, the displayed text will be in a cickable button,
-which clicked, pastes the full text.
Generated using TypeDoc
Represents a generic range, as a location and length
-Generated using TypeDoc
An array of strings with an addiontal ranges
property defining the source of the data in the orignal string.
Generated using TypeDoc
An object giving strings for the different languages PopClip supports. See [[LocalizableString]].
-Optional
daDanish language string.
-Optional
deGerman language string.
-English (US) language string.
-Optional
en-English (UK) language string.
-Optional
esSpanish language string.
-Optional
frFrench language string.
-Optional
itItalian language string.
-Optional
jaJapanese language string.
-Optional
koKorean language string.
-Optional
nlDutch language string.
-Optional
plPolish language string.
-Optional
pt-Brazilian Portuguese language string.
-Optional
ruRussian language string.
-Optional
skSlovak language string.
-Optional
trTurkish language string.
-Optional
viVietnamese language string.
-Optional
zh-Simplified Chinese language string.
-Optional
zh-Traditional Chinese language string.
-Generated using TypeDoc
A container for various utility functions and constants [[util
]] object.
Decode a Base-64 string and interpret the result as a UTF-8 string.
-Accepts both standard and URL-safe variants as input. Also accepts input with or without the =
/==
end padding.
-Throws an error if the input cannot be decoded as a UTF-8 string.
The decoded string
- -Encode a string as UTF-8 then Base-64 encode the result.
-The string to encode.
-Optional
options: { Optional
trimmed?: booleanWhether to trim the =
/==
padding from the string. Default is no.
Optional
urlWhether to encode using the URL-safe variant, with -
and _
substituted for +
and /
. Default is no.
Build a query from params object
-Build a URL from a base URL and additional query parameters
-Decipher a JSON object that has been lightly obscured to prevent constants such as -API keys appearing in plaintext in the source files.
-This function will ROT13 decipher the text, apply Base64 decoding, and parse the result as JSON.
-Readonly
constantThe constant
property is a container for pre-defined constants.
Readonly
KEY_Key code for the Delete (⌫) key.
-Readonly
KEY_Key code for the Down Arrow key.
-Readonly
KEY_Key code for the Escape key.
-Readonly
KEY_Key code for the Left Arrow key.
-Readonly
KEY_Key code for the Return (↵) key.
-Readonly
KEY_Key code for the Right Arrow key.
-Readonly
KEY_Key code for the space bar.
-Readonly
KEY_Key code for the Tab (⇥) key.
-Readonly
KEY_Key code for the Up Arrow key.
-Readonly
MODIFIER_Bit mask for the Command (⌘) key.
-Readonly
MODIFIER_Bit mask for the Control (⌃) key.
-Readonly
MODIFIER_Bit mask for the Option (⌥) key.
-Readonly
MODIFIER_Bit mask for the Shift (⇧) key.
-Localize an English string into the current user interface language, if possible. -This will work for strings which match an existing string in PopClip's user interface.
-The string to localize.
-The localized string, or the original string if no localized version was avaiable.
- -Parse a query into params object
-Generated using TypeDoc
Generated using TypeDoc
An action function is called when the user clicks the action button in PopClip. This is where -the extension does its main work.
-The selected text and related properties. (Same object as [[PopClip.selection]].)
-Current values of the options for this extension. (Same object as [[PopClip.options]].)
-Information about the context surrounding the selection. (Same object as [[PopClip.context]].)
-Generated using TypeDoc
Strings which can be used to specify the [[after]] action.
-Generated using TypeDoc
Object returned by [[Extension.auth]] when there is an authentication flow to kick off
-Optional
params: {}Optional
expect: string[]Generated using TypeDoc
Function signature of the [[Extension.auth]] method.
-Generated using TypeDoc
Strings which can be used to specify the [[before]] action.
-Generated using TypeDoc
A type to represent a localizable string.
-The value may be either a string or an object.
-If you supply a string, that string is used.
-If you supply a [[StringTable]] object, PopClip will
-display the string for the user's preferred language if possible, with fallback to the en
string.
option.label = "Color" // just use this string
option.label = { en: "Color", "en-GB": "Colour", fr: "Couleur", "zh-Hans": "颜色" }
-
-Generated using TypeDoc
Negated form of [[Requirement]].
-Generated using TypeDoc
A population function dynamically generates the actions for the extension. See [[Extension.actions]].
-The selected text and related properties. (Same object as [[PopClip.selection]].)
-Current values of the options for this extension. (Same object as [[PopClip.options]].)
-Information about the context surrounding the selection. (Same object as [[PopClip.context]].)
-A single action, an array of actions.
- -Generated using TypeDoc
A requirement is specified in the Action.requirements array as a string.
-["paste", "!urls", "option-goFishing=1"]
-
-Generated using TypeDoc
Const
The global pasteboard
object provides access to the contents of the macOS general pasteboard (i.e. the system clipboard). It implements [[Pasteboard]].
Generated using TypeDoc
Const
The global popclip
object encapsulates the user's current interaction with PopClip, and provides methods
-for performing various actions. It implements [[PopClip]].
Generated using TypeDoc
Const
The global util
object acts as a container for various utility functions and constants. It implements [[Util]].
Generated using TypeDoc
Represents a formatted text string. The underlying implementation uses a macOS Attributed String (
-NSAttributedString
) object. -Can be constructed from a plain string in RTF, HTML, or Markdown format.Example
-