Last active
August 14, 2022 20:57
-
-
Save tomrandle/456ea470fcbb3fb9b28ed2ad0bc470d7 to your computer and use it in GitHub Desktop.
Applescript for automatically starting standup
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
on run argv | |
# Set variables | |
set chrome to "Google Chrome" | |
set zoom to "zoom.us" | |
set wait to 0.5 | |
set initialWindow to "Zoom - Pro Account" # If you're not using Zoom Pro you will need to change this | |
tell application chrome | |
if it is running then | |
quit | |
delay 1 | |
end if | |
end tell | |
# Tell Chrome and Zoom to stop running if they're already open | |
tell application zoom | |
if it is running then | |
quit | |
delay 1 | |
end if | |
end tell | |
# Launch Chrome | |
tell application chrome to activate | |
# Check Chrome has started | |
tell application "System Events" | |
repeat until visible of process chrome is false | |
log "waiting for chrome process" | |
delay wait | |
set visible of process chrome to false | |
end repeat | |
# Wait for Chrome tab to load | |
set visible of process chrome to true | |
tell process chrome | |
# Wait until Clubhouse tab is loaded | |
repeat until name of window 1 contains "Taco Standup" | |
log "waiting for clubhouse to load" | |
delay wait | |
end repeat | |
end tell | |
end tell | |
# Toggle Clubhouse's fullscreen mode | |
tell application chrome to activate | |
tell application "System Events" | |
tell application chrome | |
delay 5 | |
keystroke "f" | |
end tell | |
end tell | |
# Launch Zoom.us | |
tell application zoom to activate | |
# Wait for Zoom's create meeting window to open | |
tell application "System Events" | |
repeat until visible of process zoom is false | |
log "waiting for zoom process" | |
delay wait | |
set visible of process zoom to false | |
end repeat | |
end tell | |
tell application "System Events" | |
tell process zoom | |
repeat until window initialWindow exists | |
log "waiting for create meeting window" | |
delay wait | |
end repeat | |
# Click the start video button | |
click button "Start with video" of group 0 of group 0 of group 0 of window initialWindow | |
# Set the name of the window so we can access it as it may not always be window 2 | |
set videoWindow to "Zoom" | |
# Make sure the correct Zoom window is active | |
repeat until window "Zoom" exists | |
log "waiting for video window" | |
delay wait | |
activate window | |
end repeat | |
# Check the record button has loaded | |
repeat until button "Record" of front window exists | |
log "waiting for the record button" | |
delay wait | |
end repeat | |
# Zoom now changes the window name so we need to update it so we can target it again | |
tell window videoWindow | |
# Start recording in the cloud, not locally | |
keystroke "C" using {command down, shift down} | |
# Click the share screen button to open the dialog | |
keystroke "S" using {command down, shift down} | |
end tell | |
set shareWin to "Select a window or an application that you want to share" | |
repeat until window shareWin exists | |
log "waiting for video share screen window" | |
delay wait | |
activate | |
end repeat | |
# Choose which window to share | |
tell window shareWin | |
tell scroll area 1 | |
tell UI element 1 | |
click button 1 | |
end tell | |
end tell | |
end tell | |
end tell | |
end tell | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment