PopMaker

一个PopClip扩展生成

I don’t know yet if this project is going any further, but I thought I’d share what I’ve been experimenting with. It occurred to me — after a couple dozen request for “can you make a PopClip extension for this?” — that I could probably put the power in the hands of people who aren’t necessarily comfortable editing PLIST files. I present PopMaker.

PopMaker - 图1

PopMaker is an OS X app for generating PopClip extensions. It’s currently limited in scope to “search” extensions and “surround” extensions. You simply fill in the fields and hit the button to save to disk or install immediately. It even lets you import your own icons (more info below).

As a usage example, I added an extension to my PopClip Extensions collection that searches a selected “texting” abbreviation (e.g. LOL) on textingabbreviations.ca. It took me under 15 seconds to create it and install it.

It’s ugly right now, but it works. I’ll explain it further in a second, but here’s a video that may or may not answer all your questions.

[Music based on work by Grapes, licensed under Creative Commons 3.0.]

Ok, on with the show.

The basics

Every extension you make will have a required set of fields shown at the top when you launch PopMaker:

  • Author (your name)
  • Extension Name (the long title of the extension as shown in the configuration palette)
  • Menu title (the short abbreviation that will show in the PopClip bar)

Any extension can optionally have an icon which replaces the Menu Title. Icons have certain requirements, but PopClip is actually more flexible than the documentation would lead you to believe. For the best results, though, an extension’s icon should be a square PNG file at least 256x256 pixels in size. It should consist only of a solid black figure on a transparent background. The black areas will show up white when displayed on the PopClip bar.

Extension types

Like I said, PopMaker only does two things right now. If I decide to push the project any further, this will expand and ultimately include the ability to include custom scripts. Maybe. For now, you get…

Search extensions can point to any URL, and you use {query}(verbatim) anywhere in the url string to insert the text you have selected when you click the extension. The inserted text will be url escaped automatically.

You can use this extension type to create local file urls, too, for handlers such as nvALT or Evernote. You can even use it to send Messages. You just have to know the url scheme.

Create a Search extension by opening PopMaker, filling in the fields at the top, and choosing Search from the dropdown menu. Then simply fill in the url, substituting {query} for the variable part.

Surround

Surround extensions do just what you’d think: surround selected text on either side with whatever characters you specify when generating the extension. You can use it to create Markdown extensions (| or |), CriticMarkup shortcuts, comment syntax, etc. It’s extremely simplistic, but a handy tool when you already have your hands off the keyboard to make a selection or you’re working in a text field without handy things like auto-pairing.

Create a Surround extension in the same manner as a Search extension. When you switch to the Surround style, you get two fields. Type whatever you want to go on either side of the text. Note that the generated extension will trim whitespace on either side of the selection and butt the surrounding prefix and suffix to word edges, so if you want a space, put it in the fields implicitly.

Saving extensions

Once you’ve completed the fields, you can choose to save the extension to a popclipextz file, which is a zip compressed version of the extension appropriate for sharing and distribution, or you can click the up-arrow button to send it directly up to PopClip.

There’s a checkbox in the right corner of the top half (dev mode) that, when checked, prevents the extension from being zipped before saving. You can then right click on the resulting popclipextz package and “Show Package Contents” in Finder. This is primarily for people who have some scripting knowledge and want to tweak the basic extensions further. See the PopClip Extensions documentation for helpful info.

Future

If you think you might use this and are interested in seeing this develop further, please let me know in the comments or on Twitter. I’m trying to gauge its usefulness to the general PopClip user base, and I’m curious about its App Store potential if it had a broader scope of capabilities.

Download
Download the file below, unzip and drag it to your Applications folder. Good to go.

Download PopMaker v0.1