Skip to content

Instantly share code, notes, and snippets.

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 vookimedlo/0b96e11a97928575dada71dc11d03c3c to your computer and use it in GitHub Desktop.
Save vookimedlo/0b96e11a97928575dada71dc11d03c3c to your computer and use it in GitHub Desktop.
MacOS: Set the application position and size from the command line [AppleScript]

Dictionary is the application, which shall be adjusted to the position {0, 20} and to the size {1280, 800}.

Note that this is the size of the plain window without a shadow. If you do a screenshot, you can omit a shadow by holding the ⌥ [option] key.

tell application "System Events"
    set ssProcess to first process whose name is "Dictionary"
    tell ssProcess
        tell first window
            set position to {0, 20}
            set size to {1280, 800}
        end tell
    end tell
end tell
tell application "Dictionary" to activate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment