In addition to @tf2’s answer, if you do find yourself needing to place the selected text on the clipboard you can use the before
field with a value of copy
. This will make PopClip invoke a Copy operation in the target app before the main action of the extension. An example of this is given in How to make a Key Press extension in PopClip — TextExpander example
For more advanced usages there is also a global object in the JavaScript environment called pasteboard
which has read/write property called text
which represents the plain text content of the pasteboard e,g, pasteboard.text = 'set this text'