mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 15:18:01 +00:00
Add Resize App Windows With AppleScript as a mac til
This commit is contained in:
@@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
|
||||
For a steady stream of TILs from a variety of rocketeers, checkout
|
||||
[til.hashrocket.com](https://til.hashrocket.com/).
|
||||
|
||||
_769 TILs and counting..._
|
||||
_770 TILs and counting..._
|
||||
|
||||
---
|
||||
|
||||
@@ -326,6 +326,7 @@ _769 TILs and counting..._
|
||||
- [Insert A Non-Breaking Space Character](mac/insert-a-non-breaking-space-character.md)
|
||||
- [List All The Say Voices](mac/list-all-the-say-voices.md)
|
||||
- [Require Additional JS Libraries In Postman](mac/require-additional-js-libraries-in-postman.md)
|
||||
- [Resize App Windows With AppleScript](mac/resize-app-windows-with-applescript.md)
|
||||
- [Resizing Both Corners Of A Window](mac/resizing-both-corners-of-a-window.md)
|
||||
- [Run A Hardware Check](mac/run-a-hardware-check.md)
|
||||
- [Run AppleScript Commands Inline In The Terminal](mac/run-applescript-commands-inline-in-the-terminal.md)
|
||||
|
||||
19
mac/resize-app-windows-with-applescript.md
Normal file
19
mac/resize-app-windows-with-applescript.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# Resize App Windows With AppleScript
|
||||
|
||||
I showed in a [previous
|
||||
TIL](run-applescript-commands-inline-in-the-terminal.md) how we can run
|
||||
AppleScript commands inline from the terminal. Here is an inline command
|
||||
for positioning and resizing your iTerm2 window.
|
||||
|
||||
```bash
|
||||
osascript -e 'tell application "iTerm2"
|
||||
set the bounds of the first window to {50, 50, 1280, 720}
|
||||
end tell'
|
||||
```
|
||||
|
||||
The first two values tell the command the `x` and `y` coordinates of where
|
||||
to position the upper left corner of the window relative to the upper left
|
||||
corner of your screen. The next two values are the `width` and `height` that
|
||||
the window should be resized to.
|
||||
|
||||
[source](https://apple.stackexchange.com/questions/98064/set-size-of-window-to-exact-pixels-and-place-via-x-y-coordinates)
|
||||
Reference in New Issue
Block a user