Control Chrome From Script Kit using Apple Events

InstructorJohn Lindquist

Share this video with your friends

Send Tweet

Chrome allows developers to execute JavaScript using Apple Events. When you enable this feature, you can write scripts that can access and modify the page you're currently browsing.

You can get the site's contents, update storage, or do any action you would typically do through an extension of the Chrome Dev Tools.

let value = await applescript(`
tell application "Google Chrome" to tell window 1
	get execute active tab javascript "

${js}

"
end tell
`)