Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added 1100px window on right

  • Loading branch information...
commit b537b44f8e8a1380802516606b28df180ba1e956 1 parent b6e521c
@topfunky authored
View
63 center460x580.applescript
@@ -0,0 +1,63 @@
+-- AUTHOR: Yehuda Katz
+-- MODIFIED: Geoffrey Grosenbach http://peepcode.com
+
+set windowWidth to 460
+set windowHeight to 580
+delay 0.1
+
+set AppleScript's text item delimiters to "x"
+
+-- Uncomment to see dialog
+-- set res to text returned of (display dialog "Enter the width x height:" default answer ((windowWidth & windowHeight) as text))
+-- HACK Manually set target window size
+set res to "" & windowWidth & "x" & windowHeight
+
+if res is "" then
+ display dialog "You need to enter a correct response"
+ return
+end if
+set {windowWidth, windowHeight} to text items of res
+
+set AppleScript's text item delimiters to ""
+
+-- Works with most setups
+tell application "Finder"
+ set {screen_top, screen_left, 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 "Finder"
+ set {desktopTop, desktopLeft, desktopRight, desktopBottom} to bounds of desktop
+end tell
+
+try
+ tell application "System Events"
+ tell process myFrontMost
+ set {{w, h}} to size of drawer of window 1
+ end tell
+ end tell
+on error
+ set {w, h} to {0, 0}
+end try
+
+tell application "System Events"
+ tell process myFrontMost
+ try
+ set {{w, h}} to size of drawer of window 1
+ on error
+ set {w, h} to {0, 0}
+ end try
+ set position of window 1 to {((screen_width - windowWidth - w) / 2), ((screen_height - windowHeight) / 2.0) - desktopTop}
+ set size of window 1 to {windowWidth, windowHeight}
+ end tell
+end tell
View
63 center800x400.applescript
@@ -0,0 +1,63 @@
+-- AUTHOR: Yehuda Katz
+-- MODIFIED: Geoffrey Grosenbach http://peepcode.com
+
+set windowWidth to 800
+set windowHeight to 400
+delay 0.1
+
+set AppleScript's text item delimiters to "x"
+
+-- Uncomment to see dialog
+-- set res to text returned of (display dialog "Enter the width x height:" default answer ((windowWidth & windowHeight) as text))
+-- HACK Manually set target window size
+set res to "" & windowWidth & "x" & windowHeight
+
+if res is "" then
+ display dialog "You need to enter a correct response"
+ return
+end if
+set {windowWidth, windowHeight} to text items of res
+
+set AppleScript's text item delimiters to ""
+
+-- Works with most setups
+tell application "Finder"
+ set {screen_top, screen_left, 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 "Finder"
+ set {desktopTop, desktopLeft, desktopRight, desktopBottom} to bounds of desktop
+end tell
+
+try
+ tell application "System Events"
+ tell process myFrontMost
+ set {{w, h}} to size of drawer of window 1
+ end tell
+ end tell
+on error
+ set {w, h} to {0, 0}
+end try
+
+tell application "System Events"
+ tell process myFrontMost
+ try
+ set {{w, h}} to size of drawer of window 1
+ on error
+ set {w, h} to {0, 0}
+ end try
+ set position of window 1 to {((screen_width - windowWidth - w) / 2), ((screen_height - windowHeight) / 2.0) - desktopTop}
+ set size of window 1 to {windowWidth, windowHeight}
+ end tell
+end tell
View
27 front-natural-right.applescript
@@ -0,0 +1,27 @@
+-- AUTHOR: Geoffrey Grosenbach http://peepcode.com
+
+-- Put frontmost window on right side
+
+set windowWidth to 1100
+
+-- 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)
+
+ tell process myFrontMost
+ set size of window 1 to {windowWidth, screen_height}
+ set position of window 1 to {(screen_width - windowWidth), 20}
+ end tell
+
+end tell
View
21 hide-most.applescript
@@ -0,0 +1,21 @@
+-- Hide all applications except TextMate and Terminal.
+--
+-- Author: Geoffrey Grosenbach http://peepcode.com
+-- April 2, 2009
+-- Also: http://newsgroups.derkeiler.com/Archive/Comp/comp.sys.mac.system/2006-03/msg00407.html
+
+tell application "System Events"
+ set activeProcesses to every process
+ repeat with processCounter from 1 to count activeProcesses
+ set thisProcess to item processCounter of activeProcesses
+ set visible of thisProcess to false
+ end repeat
+end tell
+
+tell application "TextMate"
+ activate
+end tell
+
+tell application "Terminal"
+ activate
+end tell
Please sign in to comment.
Something went wrong with that request. Please try again.