Created
May 20, 2025 19:23
-
-
Save cshaa/492d1c25e3f8d8fc3c5cd4ffc42953c6 to your computer and use it in GitHub Desktop.
Copy a paragraph from PDF, correctly remove hyphenation, and paste the result into VS Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addEventListener('keyup', async (e) => { | |
if (e.key !== 'x') return; | |
if (!e.ctrlKey) return; | |
const text = await navigator.clipboard.readText(); | |
await navigator.clipboard.writeText(text.replaceAll("-\n", "").replaceAll("\n", " ") + "\n\n") | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import subprocess | |
keyboard.send_keys("<ctrl>+c<ctrl>+x") | |
subprocess.run("wmctrl -a \"Visual Studio Code\"", shell=True) | |
time.sleep(0.10) | |
keyboard.send_keys("<ctrl>+v") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autokey-run -s ~/.config/autokey/data/copypaste-pdf.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment