Skip to content

Instantly share code, notes, and snippets.

@GloryAlex
Last active May 29, 2024 08:09
Show Gist options
  • Save GloryAlex/9c91a1dfd6b8267182fdd0bc6b4415d2 to your computer and use it in GitHub Desktop.
Save GloryAlex/9c91a1dfd6b8267182fdd0bc6b4415d2 to your computer and use it in GitHub Desktop.
CotEditor Script
#!/usr/bin/env python3
# %%%{CotEditorXInput=AllText}%%%
# %%%{CotEditorXOutput=Discard}%%%
import sys
import urllib.parse
import webbrowser
content = sys.stdin.read()
content = urllib.parse.quote(content)
webbrowser.open('x-marked://preview?text='+content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment