Skip to content

Instantly share code, notes, and snippets.

@LearnWebCode
Last active September 23, 2022 21:01
Show Gist options
  • Save LearnWebCode/7b3f1b495746e411645ccef54b8970bb to your computer and use it in GitHub Desktop.
Save LearnWebCode/7b3f1b495746e411645ccef54b8970bb to your computer and use it in GitHub Desktop.
macOS Tell Chrome & Safari to Be Certain Size in Certain Screen Position
tell application "Google Chrome" to activate
tell application "System Events"
tell process "Google Chrome"
click menu item "New Incognito Window" of menu "File" of menu bar 1
end tell
end tell
tell first window of application "Google Chrome" to set bounds to {0, 109, 967, 658}
tell application "Safari" to activate
tell application "System Events"
tell process "Safari"
click menu item "New Window" of menu "File" of menu bar 1
end tell
end tell
tell first window of application "Safari" to set bounds to {0, 0, 967, 633}
(* Add a command-line "record" alias with
code ~/.zshrc
At bottom of the file add:
alias record="osascript /Users/brad/Documents/Brads-AppleScripts/chrome.scpt"
*)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment