Invoking Popclip with no Selected Text

If I invoke PopClip with no selected text, the only options I have are Paste or Drafts

Questions…

(1) How can I add my own extensions (preferably via snippetss) to appear in this situation?

(2) How can I reconfigure Drafts not to appear as an option in this situation?

1 Like

Hi -
(1) the requirements field is what controls this. By default an extension appears when text is selected but you can set it to appear always by setting an empty requirements array.

In a snippet you could use the line:
requirements: []

(2) I’ve amended the Drafts extension to fix this

1 Like

Excellent - thanks

There are lots of situations where it is desirable to run a shortcut or app that does not require copying from the clipboard - sometimes that can be done via the Menu Bar but it would be much easier to be able to do it wherever the cursor is with PopClip.

Plus with a programmable mouse with extra busttons (like Logitech Mx Master) you can set one button to bring up Popclip immediately.

Very useful.

Thanks

@Nick - setting requirements: [] sets an extension to appear always as you say.

Is there any way to configure an extension to appear only when no text is selected?

Edit →

Looking at the documentation I would anticipate that !text would configure the extension to show only when no text is selected. But when I try this I get the error “invalid YAML”. Why?

# popclip
name: CNN
icon: square CNN
url: https://www.cnn.com
requirements: [!text]
1 Like

Exactly right… you’ll just need to quote the string due to the exclamation mark

# popclip
name: CNN
icon: square CNN
url: https://www.cnn.com
requirements: ['!text']

Perfect - that works really well. It gives me screen space for a whole new set of extensions not related to the clipboard. Basicaly that’s an additional menu bar wherever the mouse is currently located.

@nick my extension for Tinderbox Action Code currently requires selected text. I’d like to be able to also show the extension if no text is selected but could’t figure out how. Is this possible?

1 Like

To appear always, you need to specify an empty requirements array:

requirements: []

Or equivalent plist/json.

1 Like

Thank you! (And sorry, you already answered the question in a previous post …)

Happy holidays!

1 Like

And to you! :christmas_tree:

1 Like