Help creating an extension using Python

HI @jfontana, welcome to the forum. I haven’t looked at the code – the dropbox link seems to be faulty — but based on the “requirements statement” I put together the following sippet which seems to do the trick in JS (I’m not proficient in python)

// #popclip
// name: Clean URL
// icon: iconify:healthicons:clean-hands
// language: javascript
// requirements: [url]
// after: copy-result
return popclip.input.data.urls[0].split('?')[0]

(The above block is an extension snippet — select it then click “Install Extension” in PopClip.)

Some notes:

  • icon - I picked a random one, you can change that!
  • requirements: [url] this makes it so the action only appears when the selected text contains a URL
  • after: copy-result causes whatever is returned from the JS code to be copied to the clipboard