Trigger PopClip to appear again with the current selection.
Copy arbitrary pasteboard content.
Places the given string on the pasteboard, and shows "Copied" notificaction to the user.
The plain text string to copy
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
Options.
Bundle identifier of the app to open the URL with. For example "com.google.Chrome"
.
Paste arbitrary pasteboard content.
If 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.
The plain text string to paste
Invokes a command in the target app.
Either cut
, copy
or paste
.
Options for the command.
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.
An optional bit mask specifiying additional modifier keys, if any.
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.
If true
, and the app's Paste command is available, the displayed text will be in a cickable button,
which clicked, pastes the full text.
The current context.
The current selection.
The 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.
The current values of the options.
Generated using TypeDoc
This interface describes the methods and properties of the global
popclip
object.