Skip to content

Instantly share code, notes, and snippets.

@markshust
Last active February 28, 2021 11:39
Show Gist options
  • Select an option

  • Save markshust/90d94762a633b2b275110fd4434b7080 to your computer and use it in GitHub Desktop.

Select an option

Save markshust/90d94762a633b2b275110fd4434b7080 to your computer and use it in GitHub Desktop.
macOS Automator script to turn on and off LiveChat every day on schedule
tell application "Google Chrome"
tell window 1
tell active tab
delay 7
set str to execute javascript "if (!document.querySelector('#notifications-bar button')) document.querySelector('span.lc-switch.lc-switch--compact.addition > input').click();"
delay 3
tell application "System Events" to keystroke "w" using command down
end tell
end tell
end tell
tell application "Google Chrome"
tell window 1
tell active tab
delay 7
set str to execute javascript "document.querySelector('#notifications-bar button.lc-btn').click()"
delay 3
tell application "System Events" to keystroke "w" using command down
end tell
end tell
end tell
@markshust
Copy link
Copy Markdown
Author

Turn off Live Chat:
Screen Shot 2021-02-11 at 8 33 46 AM

Turn on Live Chat:
Screen Shot 2021-02-11 at 8 33 26 AM

Then create a recurring Apple Calendar event for each on your schedule:
Screen Shot 2021-02-11 at 8 31 07 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment