Skip to content

Instantly share code, notes, and snippets.

@henrymazza
Created October 29, 2012 18:02
Show Gist options
  • Save henrymazza/3975283 to your computer and use it in GitHub Desktop.
Save henrymazza/3975283 to your computer and use it in GitHub Desktop.
Animate Window Resize
try
set front_app to (path to frontmost application as Unicode text)
set c to 3
tell application front_app
activate
set {l, t, r, b} to bounds of window 1
log {l, t, r, b}
repeat until (((b - 150 - 804) ^ 2) ^ 0.5) < 2
set b to b + (150 + 804 - b) / c
set r to r + (240 + 1232 - r) / c
set t to t + (150 + 36 - t) / c
set l to l + (240 + 208 - l) / c
log {l, t, r, b}
set bounds of window 1 to {l, t, r, b}
end repeat
end tell
end try
@henrymazza
Copy link
Author

The loop works surprisingly well to animate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment