Skip to content

Instantly share code, notes, and snippets.

@s4lt3d
Last active December 24, 2025 19:14
Show Gist options
  • Select an option

  • Save s4lt3d/cf1df9e09c4be75b3267c14343009c82 to your computer and use it in GitHub Desktop.

Select an option

Save s4lt3d/cf1df9e09c4be75b3267c14343009c82 to your computer and use it in GitHub Desktop.
Fixes semicolon issues };
import pyperclip
import pyautogui
import time
def type_clipboard_content():
text = pyperclip.paste()
text = text.replace("\n}", "}")
segments = text.split('}')
for i, segment in enumerate(segments):
time.sleep(0.1)
# If this segment starts with ';', remove it for now
had_semicolon = False
if segment.startswith(';'):
segment = segment[1:]
had_semicolon = True
pyautogui.typewrite(segment, interval=0.01)
if i < len(segments) - 1:
remainder = segments[i + 1].lstrip()
if remainder.startswith(';'):
# Inline initializer case
pyautogui.press('right')
time.sleep(0.05)
pyautogui.typewrite(';', interval=0.01)
else:
# Block close
pyautogui.press('down')
time.sleep(0.1)
if __name__ == "__main__":
time.sleep(4)
type_clipboard_content()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment