Back to Blog

How to Use RewriteBar with PopClip

The latest version of Rewritebar now supports PopClip. This means you can now trigger Rewritebar from PopClip.

Posted by

RewriteBar PopClip Integration

I am happy to announce that Rewritebar (v2.4.0) now supports PopClip, which was the most requested feature on the features board. This means you can now use RewriteBar together with PopClip by triggering an action from the PopClip floating menu. Here is how you can do it.

Current options

RewriteBar supports two modes of integration:

  1. Command Menu Snippet: Open a menu where you can select the command you want to use.
  2. Snippet to Execute a Specific Command: Executes a specific command directly. E.g., Grammar Correction

How to install a Snippet

RewriteBar shows a button on each command and in the general settings view that shows the snippet to install the PopClip extension.

Step by step:

  1. Navigate to a place where a PopClip Button is available (General Settings or a command)
  2. Click on the "PopClip" button.
  3. Select the text in the text field
  4. Wait for the PopClip UI
  5. Click on the "Install Extension...".

A Video how to install a snippet

Optional Configuration:

The text field to install a snippet is editable. This means you can adjust the snippet to your needs before installing it. Here are the fields you can adjust:

  • Name: The name of the snippet
  • Icon: RewriteBar already inserts the command icon, but you can replace it with any icon you like.
  • Optional Parameters: Depending on the command, you can pass additional parameters. For example, the language parameter for the translate command.

Example Snippets

Command Menu Snippet

This snippet opens the command menu, where you can select a RewriteBar command.

// #popclip
// name: RewriteBar
// icon: symbol:sparkles
// language: javascript

pasteboard.text = popclip.input.text;
popclip.openUrl("rewritebar://command-menu");

Fix Grammar & Spelling

This snippet executes the Fix Grammar & Spelling command directly. Your selected text will be directly replaced by the corrected version.

// #popclip
// name: Fix Grammar & Spelling
// icon: symbol:pencil.tip.crop.circle
// language: javascript

pasteboard.text = popclip.input.text;
popclip.openUrl("rewritebar://command/fix-grammar-spelling");

Translate and Change Tone

These two commands are a bit special. They require a further parameter, such as the language or the tone. This offers you the ability to use the same command for different languages and tones, and to define any language or tone you want.

// #popclip
// name: Translate to {language}
// icon: symbol:globe
// language: javascript

pasteboard.text = popclip.input.text;
popclip.openUrl("rewritebar://command/translate/{language}");

Helpful resources

FAQ

Does PopClip integration work on all apps?

Yes, PopClip integration works on any app where you can select text and where PopClip is enabled. This includes web browsers, text editors, email clients, and more.

Can I create multiple snippets for different commands?

Absolutely! You can create as many snippets as you need. For example, you might want separate snippets for grammar correction, translation to specific languages, and different tone adjustments.

What happens if RewriteBar is not running when I use a PopClip snippet?

If RewriteBar is not running when you use a PopClip snippet, it will automatically launch RewriteBar and then execute your command.

Can I modify the snippets after installation?

To modify a snippet, you'll need to uninstall the existing one and install it again with your desired changes. First, uninstall through PopClip's extension settings (click the PopClip menu bar icon → Extensions → click the 'x' next to the snippet). Then follow the installation steps again with your modified configuration.

How do I reinstall a snippet?

To reinstall a snippet, first uninstall it through PopClip's extension settings (click the PopClip menu bar icon → Extensions → click the 'x' next to the snippet). Then follow the installation steps again to install the updated version.

Is there a limit to how much text I can process through PopClip?

The text limit is the same as when using RewriteBar directly. For optimal performance, I recommend selecting single sentences or paragraphs at a time.

Feedback or Questions

If you have any feedback or questions, please feel free to reach out to me via email.