Last active
October 12, 2015 11:07
-
-
Save barberj/4016929 to your computer and use it in GitHub Desktop.
AppleScript to arrange my application windows
This file contains 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
# determine if dual monitors | |
tell application "Finder" | |
set bnds to bounds of window of desktop | |
set dualmonitors to item 3 of bnds > 1440 | |
end tell | |
tell application "campfire" | |
activate | |
# { left of screen to left edge, | |
# top of screen to top edge, | |
# left screen to right edge, | |
# top of screen to bottom edge } | |
if dualmonitors then | |
set the bounds of front window to {1920, 780, 2760, 1080} | |
else | |
set the bounds of front window to {0, 600, 840, 900} | |
end if | |
end tell | |
tell application "Microsoft Outlook" | |
activate | |
if dualmonitors then | |
set the bounds of front window to {1920, 165, 3165, 760} | |
else | |
set the bounds of front window to {0, 22, 1245, 595} | |
end if | |
end tell | |
tell application "iChat" | |
activate | |
# if more then one window | |
# the first window is the chat window | |
# window name is inconsistent. Its whomever you were chatting with | |
if (count windows) > 1 then | |
if dualmonitors then | |
set bnds to {2765, 780, 3165, 1080} | |
else | |
set bnds to {845, 600, 1245, 900} | |
#set the bounds of front window to {845, 600, 1245, 900} | |
end if | |
repeat with w in windows | |
if w's name is not "iChat Buddies" then | |
set the bounds of w to bnds | |
end if | |
end repeat | |
end if | |
tell window "iChat Buddies" | |
if dualmonitors then | |
set the bounds to {3170, 180, 3360, 1080} | |
else | |
set the bounds to {1250, 22, 1440, 900} | |
end if | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment