Skip to content

Instantly share code, notes, and snippets.

@subtleGradient
Created June 18, 2021 01:13
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 subtleGradient/6a76a95f0706ac60055c18ebe20d30bd to your computer and use it in GitHub Desktop.
Save subtleGradient/6a76a95f0706ac60055c18ebe20d30bd to your computer and use it in GitHub Desktop.
#!/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