Using AI to create PopClip extensions

ChatGPT 5 made an extension for me. Give it a whirl. It seems to help if you refer it to the page giving instructions (PopClip Extensions Developer Reference) for making the extension as examples of the exact output helps it to understand what you want.

I’ve spun your post to its own topic. I’ve tried in the past with mixed success. A lot of the time , the AI has got things completely wrong and made up fields and that don’t exist. Then people ask me whu they don’t work :upside_down_face:. I noticed GPT-5 seems to be much better but still needs guidance. I think a well written starter prompt with good examples would do wonders for its capability. This maybe people can use this thread to share ideas/tips.

2 Likes

Here’s a ChatGPT 5 exchange where I had it reference Snippets — PopClip Developer and Extensions — PopClip. I’m sure you can immediately see if it is on or off the mark.

PopClip Extensions: Writing Tools, Shortcut Trigger, and Snippet Install

This guide compiles answers from a chat starting at the question ā€œCan you write a PopClip extension that opens the macOS writing tools?ā€ through the end of that thread. It includes three practical ways to use PopClip: a Dictionary extension (as a proxy for macOS writing tools), a shortcut-sending extension for āŒ˜āŒ„ā‡§W, and a one‑block PopClip snippet you can select and install instantly.

1) Open macOS Writing Tools via Dictionary (practical proxy)

macOS doesn’t expose a single universal API to open ā€œWriting Toolsā€ directly. A reliable alternative is to open the selected word in Dictionary.app via the dict:// URL scheme.

Steps:

Ā· Create a folder named: OpenInDictionary.popclipext

Ā· Inside it, create a file named: Config.plist

Ā· Paste the following XML, save, then double‑click the folder to install.

Config.plist:

<?xml version="1.0" encoding="UTF-8"?> identifier com.yourname.openindictionary name Open in Dictionary icon šŸ“– description Open selected word in Dictionary.app requirements text actions title Dictionary shell script open "dict://%text%"

Notes:

Ā· This works anywhere PopClip can read selected text.

Ā· You can change the icon or name as you like.

2) Send the āŒ˜āŒ„ā‡§W shortcut from PopClip

Use AppleScript via System Events to simulate the keypress. Ensure System Events has Accessibility permission in System Settings → Privacy & Security → Accessibility.

Steps:

Ā· Create a folder named: SendCmdOptShiftW.popclipext

Ā· Inside it, create a file named: Config.plist

Ā· Paste the XML below, save, then double‑click the folder to install.

Config.plist:

/** Config.plist **/

<?xml version="1.0" encoding="UTF-8"?> identifier com.yourname.sendcmdoptshiftw name Press āŒ˜āŒ„ā‡§W icon ⌘ description Simulate Command+Option+Shift+W requirements text actions title Send Shortcut shell script /usr/bin/osascript -e 'tell application "System Events" to keystroke "w" using {command down, option down, shift down}'

Notes:

Ā· Change ā€œwā€ to another key if needed.

Ā· You can add multiple actions (titles + scripts) inside the actions array.

3) One‑block install with a PopClip snippet

PopClip can install an extension directly from selected text if it starts with PopClip and is valid YAML (≤ ~5000 characters). Select the whole block below and click ā€˜Install Extension’ in PopClip.

Snippet:

PopClip
name: Send Cmd Opt Shift W
icon: ⌘
key combo: command option shift W

What each field means:

Ā· name — label shown in PopClip.

Ā· icon — any emoji or text glyph.

Ā· key combo — built‑in ā€˜Key Press’ action; list modifiers (command, option, shift, control) then the key.

Tips:

Ā· Multiple actions: use an actions: list instead of a single key combo.

Ā· Distribution: paste the snippet in a post or email—others can select and install instantly.

Ā· File method: save as Something.popcliptxt and double‑click to install.

Nah, that’s not good.

I had a go at making a single text prompt with guidance for the LLM aimed at making snippets in the modern format rather than putting XML into .popclipext folders like that.

Try this prompt by copying and pasting it into your LLM of choice:

https://gist.githubusercontent.com/pilotmoon/c6f776ebf5524c69db466dce355ffc25/raw/0574ba1a2ff5c77070629a44e1ab94c0c31cfbba/PROMPT.md

There is much room for improvement I’m sure, but it seems to work fairly well for simple stuff.

1 Like

Exactly what I was looking for.

Thank you!

1 Like