What is it?

A script to join a Google Meet. And yes, I mean join, as in, you will end up in the meeting. So make sure you are ready! 💇🏻 💅🏻

Installation

Add to your ScriptKit

Do you haz teh codez?

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);

// Find a span with the text "Join now" and click its parent button
const js = `Array.prototype.filter.call(
  document.querySelectorAll('button span'),
  (el) => (el.textContent.trim() === 'Join now')
)[0].parentElement.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
`);

How does it work?

When using it for the first time, it will ask you for the Google Meet URL, which will be stored as an environment variable, and will be used from then on.

It will open your default browser, open a new tab, go to the Google Meet URL, click Join, and before you know it, you're in.

Limitations

  1. The script assumes you are already signed in to Google in your default browser

  2. It only supports one Meet URL, you can't choose between multiple.