Created
April 23, 2020 23:57
-
-
Save mfcollins3/e29fc449706bd6f0acf32807329e329e to your computer and use it in GitHub Desktop.
Shell script to resize Visual Studio Code's window to 1080p resolution for screen recording
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env zsh | |
| # Original code modified from https://www.labnol.org/software/resize-mac-windows-to-specific-size/28345/ | |
| osascript <<EOF | |
| set appWidth to 1920 | |
| set appHeight to 1080 | |
| tell application "Finder" | |
| set screenResolution to bounds of window of desktop | |
| end | |
| set screenWidth to item 3 of screenResolution | |
| set screenHeight to item 4 or screenResolution | |
| set xOrigin to (screenWidth - appWidth) / 2 as integer | |
| set yOrigin to (screenHeight - appHeight) / 2 as integer | |
| tell application "System Events" | |
| tell process "Electron" | |
| tell window 1 | |
| set its size to [appWidth, appHeight] | |
| set its position to [xOrigin, yOrigin] | |
| end | |
| end | |
| end | |
| EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment