Skip to content

Instantly share code, notes, and snippets.

@ilobko
Created August 9, 2022 11:15
Show Gist options
  • Save ilobko/7a265d99adc59e5f8f1df15b5ea3f0b5 to your computer and use it in GitHub Desktop.
Save ilobko/7a265d99adc59e5f8f1df15b5ea3f0b5 to your computer and use it in GitHub Desktop.

Revisions

  1. ilobko revised this gist Aug 9, 2022. No changes.
  2. ilobko created this gist Aug 9, 2022.
    11 changes: 11 additions & 0 deletions Set Window Width 1280.workflow
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    set windowWidth to 1280
    set currentApplication to (path to frontmost application as Unicode text)

    tell application currentApplication
    set windowBounds to bounds of the front window
    set upperLeftX to item 1 of windowBounds
    set upperLeftY to item 2 of windowBounds
    set lowerRightY to item 4 of windowBounds

    set bounds of the first window to {upperLeftX, upperLeftY, upperLeftX + windowWidth, lowerRightY}
    end tell