def main(): commandLineControlMac() bootZoom() global text_stream start_state_checking(1) start_listen() while True: while KEYWORD not in text_stream[0]: time.sleep(.25) raw_text = text_stream[0] text_stream[0] = '' print(raw_text) print(state) if curr_system == 'Darwin': os.system( '''/usr/bin/osascript -e 'tell app "Finder" to set frontmost of process "zoom.us" to true' ''' ) else: shortcut('focus') time.sleep(.1) raw_text = sliceAfterSubstr(raw_text, KEYWORD) if " and " in raw_text: texts = [ sliceUpToSubstr(raw_text, " and "), sliceAfterSubstr(raw_text, " and ") ] else: texts = [raw_text] for text in texts: if not text.strip(): continue compared = mostSimilar(text, [x for x in vectorized_commands])[0] if 'send this message' not in compared: text = compared for command, callback in commands.items(): if command in text: if 'send' in command: if 'message' in command: callback( sliceAfterSubstr(text, command + ' ') + '\n') else: callback(macros[command]) else: callback() break
def leave_meeting(): shortcut('toggle_leave_meeting', content='\n')
def send_chat(message): if state['chat'] == 1: shortcut('toggle_chat') shortcut('toggle_chat', content=message)
def toggle_hand(): shortcut('toggle_hand')
def open_chat(): if state['chat'] == 0: shortcut('toggle_chat')
def close_chat(): if state['chat'] == 1: shortcut('toggle_chat')
def start_share(): if state['share'] == 0: shortcut('toggle_share', content='\n')
def stop_share(): if state['share'] == 1: shortcut('toggle_share')
def stop_video(): if state['video'] == 1: shortcut('toggle_video')
def start_video(): if state['video'] == 0: shortcut('toggle_video')
def mute(): if state['audio'] == 1: shortcut('toggle_audio')
def unmute(): if state['audio'] == 0: shortcut('toggle_audio')
def toggle_fullscreen(): shortcut('toggle_fullscreen')