-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlauncher.py
More file actions
29 lines (22 loc) · 909 Bytes
/
Copy pathlauncher.py
File metadata and controls
29 lines (22 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import sys
import base64
import subprocess
import os
CHROME_PATH = r"C:\Program Files\Google\Chrome\Application\chrome.exe"
def main():
if len(sys.argv) > 1:
original_text = sys.argv[1]
text_bytes = original_text.encode('utf-8')
base64_bytes = base64.b64encode(text_bytes)
base64_string = base64_bytes.decode('utf-8')
url = f'http://127.0.0.1:5010/?clipboard=true&multiline=true&rows=20&s_b64={base64_string}'
if not os.path.exists(CHROME_PATH):
print(f"Error: Could not find Chrome at path: {CHROME_PATH}")
print("Please correct the path in the CHROME_PATH variable in the launcher.py script")
input("Press Enter to exit...")
return
subprocess.run([CHROME_PATH, url])
else:
print("No text was provided for processing.")
if __name__ == '__main__':
main()