Last active
November 12, 2016 02:18
-
-
Save rakuishi/1b0985cc7fec45e57e72fb99cd989208 to your computer and use it in GitHub Desktop.
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
(* | |
* Before running following codes, this script has to be allowed assistive access. | |
* System Preferences -> Security & Privacy -> Privacy -> Accessibility | |
*) | |
tell application "Finder" | |
set desktopBounds to bounds of window of desktop | |
set desktopWidth to item 3 of desktopBounds | |
set desktopHeight to item 4 of desktopBounds | |
end tell | |
tell application "System Events" | |
set process1 to item 1 of (every process whose frontmost is true) | |
tell process1 | |
set window1 to item 1 of (every window whose subrole is "AXStandardWindow") | |
set position of window1 to {0, 0} | |
set size of window1 to {desktopWidth / 2, desktopHeight} | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment