Browse files

Extra script to move window to left monitor in my current setup

Fix variable names for screen_left and top
  • Loading branch information...
1 parent 6dce727 commit 445e23738d723adcfee6599d68b112cdadb3ed0c @topfunky committed Aug 21, 2008
Showing with 27 additions and 8 deletions.
  1. +1 −0 .gitignore
  2. +1 −1 front-half-left.applescript
  3. +1 −1 front-half-right.applescript
  4. +1 −1 front-natural-left.applescript
  5. +22 −0 left-screen.applescript
  6. +1 −5 maximize.applescript
View
1 .gitignore
@@ -1 +1,2 @@
*.scpt
+.DS_Store
View
2 front-half-left.applescript
@@ -2,7 +2,7 @@
-- Works with most setups
tell application "Finder"
- set {screen_top, screen_left, screen_width, screen_height} to bounds of window of desktop
+ set {screen_left, screen_top, screen_width, screen_height} to bounds of window of desktop
end tell
-- NOTE This may work better with some multi-monitor setups
View
2 front-half-right.applescript
@@ -2,7 +2,7 @@
-- Works with most setups
tell application "Finder"
- set {screen_top, screen_left, screen_width, screen_height} to bounds of window of desktop
+ set {screen_left, screen_top, screen_width, screen_height} to bounds of window of desktop
end tell
-- NOTE This may work better with some multi-monitor setups
View
2 front-natural-left.applescript
@@ -2,7 +2,7 @@
-- Works with most setups
tell application "Finder"
- set {screen_top, screen_left, screen_width, screen_height} to bounds of window of desktop
+ set {screen_left, screen_top, screen_width, screen_height} to bounds of window of desktop
end tell
-- NOTE This may work better with some multi-monitor setups
View
22 left-screen.applescript
@@ -0,0 +1,22 @@
+-- DESCRIPTION: Put frontmost window on left screen in my dual monitor setup.
+
+-- Works with most setups
+tell application "Finder"
+ set {screen_left, screen_top, screen_width, screen_height} to bounds of window of desktop
+end tell
+
+-- NOTE This may work better with some multi-monitor setups
+-- tell application "Safari"
+-- set screen_width to (do JavaScript "screen.availWidth" in document 1)
+-- set screen_height to (do JavaScript "screen.availHeight" in document 1)
+-- end tell
+
+tell application "System Events"
+ set myFrontMost to name of first item of (processes whose frontmost is true)
+end tell
+
+tell application "System Events"
+ tell process myFrontMost
+ set position of window 1 to {(screen_left + 200), (screen_top + 500)}
+ end tell
+end tell
View
6 maximize.applescript
@@ -1,6 +1,6 @@
-- Works with most setups
tell application "Finder"
- set {screen_top, screen_left, screen_width, screen_height} to bounds of window of desktop
+ set {screen_left, screen_top, screen_width, screen_height} to bounds of window of desktop
end tell
-- NOTE This may work better with some multi-monitor setups
@@ -13,10 +13,6 @@ tell application "System Events"
set myFrontMost to name of first item of (processes whose frontmost is true)
end tell
-tell application "Finder"
- set {desktopTop, desktopLeft, desktopRight, desktopBottom} to bounds of desktop
-end tell
-
try
tell application "System Events"
tell process myFrontMost

0 comments on commit 445e237

Please sign in to comment.