Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env osascript -l JavaScript
// macOS JXA JavaScript for Automation
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function run(argv) {
Application('Safari').activate();
const { Safari } = Application('System Events').applicationProcesses;
const { Develop } = Safari.menuBars[0].menuBarItems;
Develop.menus[0].menuItems
.whose({ name: { _beginsWith: 'Simulator ' } })[0]
.menus[0].menuItems.whose({ name: { _beginsWith: 'localhost' } })[0]
.click();
Develop.click();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment