-
Notifications
You must be signed in to change notification settings - Fork 2
/
program_functions.py
137 lines (117 loc) · 6.59 KB
/
program_functions.py
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import os
import colorama
from speech_engine import casper_speak
from chronicle_engine import chronicle_log
from colorama import Fore, Back
colorama.init(autoreset=True)
def open_program(command, voice_var, log):
if "chrome" in command.lower():
print(Fore.GREEN + "Opening Google Chrome".center(100))
casper_speak(speak="Opening Google Chrome", voice=voice_var)
os.startfile("C:/Program Files (x86)/Google/Chrome/Application/chrome.exe")
chronicle_log(write=Fore.GREEN + "Opening Google Chrome".center(100), var=log)
return
elif "drive" in command:
print(Fore.GREEN + "Opening Google Drive".center(100))
casper_speak(speak="Opening Google Drive", voice=voice_var)
os.startfile("C:/Program Files/Google/Drive File Stream/56.0.11.0/GoogleDriveFS.exe")
chronicle_log(write=Fore.GREEN + "Opening Google Drive".center(100), var=log)
return
elif "code" in command.lower():
print(Fore.GREEN + "Opening Visual Studio Code".center(100))
casper_speak(speak="Opening Visual Studio Code", voice=voice_var)
os.startfile("C:/Users/ashfa/AppData/Local/Programs/Microsoft VS Code/Code.exe")
chronicle_log(write=Fore.GREEN + "Opening Visual Studio Code".center(100), var=log)
return
elif "downloader" in command or "video" in command.lower():
print(Fore.GREEN + "Opening YouTube Downloader".center(100))
casper_speak(speak="Opening YouTube Downloader", voice=voice_var)
os.startfile("C:/Users/ashfa/OneDrive/Documents/My Projects/My YT Downloader/YT Downloader.exe")
chronicle_log(write=Fore.GREEN + "Opening YouTube Downloader".center(100), var=log)
return
elif "word" in command:
print(Fore.GREEN + "Opening Microsoft Word".center(100))
casper_speak(speak="Opening Microsoft Word", voice=voice_var)
os.startfile("C:/Program Files (x86)/Microsoft Office/root/Office16/WINWORD.EXE")
chronicle_log(write=Fore.GREEN + "Opening Microsoft Word".center(100), var=log)
return
elif "excel" in command or "worksheet" in command:
print(Fore.GREEN + "Opening Microsoft Excel".center(100))
casper_speak(speak="Opening Microsoft Excel", voice=voice_var)
os.startfile("C:/Program Files (x86)/Microsoft Office/root/Office16/EXCEL.EXE")
chronicle_log(write=Fore.GREEN + "Opening Microsoft Excel".center(100), var=log)
return
elif "access" in command or "database" in command:
print(Fore.GREEN + "Opening Microsoft Access".center(100))
casper_speak(speak="Opening Microsoft Access", voice=voice_var)
os.startfile("C:/Program Files (x86)/Microsoft Office/root/Office16/MSACCESS.EXE")
chronicle_log(write=Fore.GREEN + "Opening Microsoft Access".center(100), var=log)
return
elif "explorer" in command.lower():
print(Fore.GREEN + "Opening File Explorer".center(100))
casper_speak(speak="Opening File Explorer", voice=voice_var)
os.startfile("C:/Windows/explorer.exe")
chronicle_log(write=Fore.GREEN + "Opening File Explorer".center(100), var=log)
return
elif "notepad" in command.lower():
print(Fore.GREEN + "Opening Notepad".center(100))
casper_speak(speak="Opening Notepad", voice=voice_var)
os.startfile("C:/Program Files/WindowsApps/Microsoft.WindowsNotepad_11.2310.13.0_x64__8wekyb3d8bbwe/Notepad/Notepad.exe")
chronicle_log(write=Fore.GREEN + "Opening Notepad".center(100), var=log)
return
elif "zoom" in command.lower():
print(Fore.GREEN + "Opening Zoom".center(100))
casper_speak(speak="Opening Zoom", voice=voice_var)
os.startfile("C:/Users/ashfa/AppData/Roaming/Zoom/bin/Zoom.exe")
chronicle_log(write=Fore.GREEN + "Opening Zoom".center(100), var=log)
return
elif "activate VPN" in command:
print(Fore.GREEN + "Activating VPN".center(100))
casper_speak(speak="Activating VPN", voice=voice_var)
os.startfile("C:/Program Files (x86)/Windscribe/WindscribeLauncher.exe")
chronicle_log(write=Fore.GREEN + "Activating VPN".center(100), var=log)
return
elif "task manager" in command.lower():
print(Fore.GREEN + "Accessing Task Manager".center(100))
casper_speak(speak="Accessing Task Manager", voice=voice_var)
os.startfile("%windir%/system32/taskmgr.exe /7")
chronicle_log(write=Fore.GREEN + "Accessing Task Manager".center(100), var=log)
return
########################################################################################################
def close_program(command, voice_var, log):
if "chrome" in command:
print(Fore.GREEN + "Closing Google Chrome".center(100))
casper_speak(speak="Closing Google Chrome", voice=voice_var)
os.system("taskkill /f /im chrome.exe")
chronicle_log(write=Fore.GREEN + "Closing Google Chrome".center(100), var=log)
return
elif "zoom" in command.lower():
print(Fore.GREEN + "Closing Zoom".center(100))
casper_speak(speak="Closing Zoom", voice=voice_var)
os.startfile("taskkill /f /im Zoom.exe")
chronicle_log(write=Fore.GREEN + "Closing Zoom".center(100), var=log)
return
elif "excel" in command or "worksheet" in command:
print(Fore.GREEN + "Closing Microsoft Excel".center(100))
casper_speak(speak="Closing Microsoft Excel", voice=voice_var)
os.system("taskkill /f /im excel.exe")
chronicle_log(write=Fore.GREEN + "Closing Microsoft Excel".center(100), var=log)
return
elif "word" in command:
print(Fore.GREEN + "Closing Microsoft Word".center(100))
casper_speak(speak="Closing Microsoft Word", voice=voice_var)
os.system("taskkill /f /im winword.exe")
chronicle_log(write=Fore.GREEN + "Closing Microsoft Word".center(100), var=log)
return
elif "code" in command.lower():
print(Fore.GREEN + "Closing Visual Studio Code".center(100))
casper_speak(speak="Closing Visual Studio Code", voice=voice_var)
os.system("taskkill /f /im Code.exe")
chronicle_log(write=Fore.GREEN + "Closing Visual Studio Code".center(100), var=log)
return
elif "close notepad" in command.lower():
print(Fore.GREEN + "Closing Notepad".center(100))
casper_speak(speak="Closing Notepad", voice=voice_var)
os.system("taskkill /f /im notepad.exe")
chronicle_log(write=Fore.GREEN + "Closing Notepad".center(100), var=log)
return