Last active
December 24, 2025 19:14
-
-
Save s4lt3d/cf1df9e09c4be75b3267c14343009c82 to your computer and use it in GitHub Desktop.
Fixes semicolon issues };
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 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