Skip to content

Instantly share code, notes, and snippets.

@bouwe77
Created September 16, 2022 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bouwe77/0dc55bcfe8b274f1c75e5fdbc74a7309 to your computer and use it in GitHub Desktop.
Save bouwe77/0dc55bcfe8b274f1c75e5fdbc74a7309 to your computer and use it in GitHub Desktop.
import "@johnlindquist/kit";
// Name: Join Google Meet
// Description: Joins the Google Meet URL by opening it in the browser and clicking "Join"
// Shortcut: CMD 1
// IMPORTANT: This script uses AppleScript to interact with the Google Meet page,
// so be sure to enable AppleScript in Chrome: View -> Developer -> Allow JavaScript from Apple Events
const meetUrl = await env("MEET_URL", async () => {
const urlToSave = await arg("Enter URL to Google Meet");
return urlToSave;
});
await browse(meetUrl);
// wait ~2 seconds for page to load before sending the click
await wait(2000);
// To click the "Join" button in the DOM, we search by a pretty obscure, but constant name:
const buttonName = "Qx7uuf";
const js = `document.querySelector('[jsname=\\"${buttonName}\\"]').click();`;
// Execute the JS to click the button on the active tab with AppleScript
await applescript(`
tell application "Google Chrome" to tell window 1
execute active tab javascript "${js}"
end tell
`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment