Advertisement
jeffharbert

Move and Resize Windows with AutoHotKey

Feb 24th, 2013
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;This script resizes and moves the current active window
  2. ;so that it's 1280 pixels wide and right-aligned on my
  3. ;1680 x 1050 monitor
  4. ;Brief annotations:
  5. ;Set the trigger to Ctrl+Alt+1
  6. !^1::
  7. ;Hold down the left Windows key
  8. Send {LWin Down}
  9. ;Press the left arrow key
  10. Send {Left}
  11. ;Release the left Windows key
  12. Send {LWin Up}
  13. ;Sleep for .1 seconds
  14. Sleep 100
  15. ;Resize the window to 1280 pixels wide
  16. MouseClickDrag, left, 838, 540, 1278, 540
  17. ;Sleep for .1 seconds
  18. Sleep 100
  19. ;Move the window 400 pixels to the right
  20. MouseClickDrag, left, 200 , 10, 600, 10
  21. ;End the script
  22. Return
  23.  
  24. ;Script without annotations:
  25. !^1::
  26. Send {LWin Down}
  27. Send {Left}
  28. Send {LWin Up}
  29. Sleep 100
  30. MouseClickDrag, left, 838, 540, 1278, 540
  31. Sleep 100
  32. MouseClickDrag, left, 200 , 10, 600, 10
  33. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement