Permalink
Browse files

Cleanup and removal of unused scripts.

  • Loading branch information...
1 parent 21f0b7e commit 22294a23c79db5d845d311db49143aa003f14c10 @topfunky committed Mar 9, 2009
View
@@ -1,22 +0,0 @@
--- Put Terminal on one side and TextMate on the other
-
-tell application "System Events"
-
- -- TODO hide all other apps
-
- tell process "Terminal"
- set position of window 1 to {0, 50}
- set size of window 1 to {700, 800}
- end tell
-
- tell process "TextMate"
- -- 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 {700, 50}
- set size of window 1 to {800, 794}
- end tell
-
-end tell
View
@@ -1,22 +0,0 @@
--- Put Terminal on one side and TextMate on the other
-
-tell application "System Events"
-
- -- TODO hide all other apps
-
- tell process "Terminal"
- set position of window 1 to {800, 50}
- set size of window 1 to {700, 800}
- end tell
-
- tell process "TextMate"
- -- 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 {0, 50}
- set size of window 1 to {800, 794}
- end tell
-
-end tell
View
@@ -1,62 +0,0 @@
--- DESCRIPTION: Minor modification to put the window in the top quarter of the screen.
-
-set windowWidth to 1000
-set windowHeight to 600
-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 "1000x600"
-
-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) / 4.0) - desktopTop}
- set size of window 1 to {windowWidth, windowHeight}
- end tell
-end tell
View
@@ -1,3 +1,6 @@
+-- AUTHOR: Yehuda Katz
+-- MODIFIED: Geoffrey Grosenbach http://peepcode.com
+
set windowWidth to 1000
set windowHeight to 600
delay 0.1
@@ -6,9 +9,8 @@ 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 "1000x600"
+set res to "" & windowWidth & "x" & windowHeight
if res is "" then
display dialog "You need to enter a correct response"
View
@@ -1,3 +1,6 @@
+-- AUTHOR: Yehuda Katz
+-- MODIFIED: Geoffrey Grosenbach http://peepcode.com
+
set windowWidth to 800
set windowHeight to 600
delay 0.1
@@ -6,9 +9,8 @@ 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 "800x600"
+set res to "" & windowWidth & "x" & windowHeight
if res is "" then
display dialog "You need to enter a correct response"
@@ -1,3 +1,5 @@
+-- AUTHOR: Geoffrey Grosenbach http://peepcode.com
+
-- Put frontmost window on left half
-- Works with most setups
@@ -13,7 +15,7 @@ end tell
tell application "System Events"
- set myFrontMost to name of first item of (processes whose frontmost is true)
+ set myFrontMost to name of first item of (processes whose frontmost is true)
tell process myFrontMost
set size of window 1 to {(screen_width/2), screen_height}
@@ -1,3 +1,5 @@
+-- AUTHOR: Geoffrey Grosenbach http://peepcode.com
+
-- Put frontmost window on right half
-- Works with most setups
@@ -13,7 +15,7 @@ end tell
tell application "System Events"
- set myFrontMost to name of first item of (processes whose frontmost is true)
+ set myFrontMost to name of first item of (processes whose frontmost is true)
tell process myFrontMost
set size of window 1 to {(screen_width/2), screen_height}
@@ -1,3 +1,5 @@
+-- AUTHOR: Geoffrey Grosenbach http://peepcode.com
+
-- Put frontmost window on left side
-- Works with most setups
@@ -13,7 +15,7 @@ end tell
tell application "System Events"
- set myFrontMost to name of first item of (processes whose frontmost is true)
+ set myFrontMost to name of first item of (processes whose frontmost is true)
tell process myFrontMost
set size of window 1 to {1040, screen_height}
View
@@ -1,22 +0,0 @@
--- 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 + 250), (screen_top)}
- end tell
-end tell
View
@@ -1,3 +1,7 @@
+-- Maximize frontmost window.
+--
+-- AUTHOR: Geoffrey Grosenbach http://peepcode.com
+
-- Works with most setups
tell application "Finder"
set {screen_left, screen_top, screen_width, screen_height} to bounds of window of desktop
@@ -33,4 +37,4 @@ tell application "System Events"
set position of window 1 to {0, 0}
set size of window 1 to {screen_width - w, screen_height}
end tell
-end tell
+end tell
@@ -1,4 +1,4 @@
--- Take a folder and show the total duration of all the movie files in it.
+-- DESCRIPTION: Takes a folder and shows the total duration of all the movie files in it.
--
-- AUTHOR: Geoffrey Grosenbach http://topfunky.com
-- August 29, 2008
@@ -7,37 +7,37 @@ on open (args)
set myFolder to (the first item of args)
- tell application "Finder"
- set movFiles to (files of folder myFolder whose name contains ".mov")
- end
+ tell application "Finder"
+ set movFiles to (files of folder myFolder whose name contains ".mov")
+ end
- tell application "QuickTime Player"
- set totalDuration to 0
+ tell application "QuickTime Player"
+ set totalDuration to 0
- repeat with movFile in movFiles
-
- open movFile
- set movProperties to the properties of the front document
- set movDuration to the duration of movProperties
-
- set totalDuration to totalDuration + movDuration
- close the front document
-
- end repeat
-
- end tell
-
- set totalDurationSeconds to totalDuration / 1000
- set totalDurationMinutes to (totalDurationSeconds / 60) as integer
+ repeat with movFile in movFiles
+
+ open movFile
+ set movProperties to the properties of the front document
+ set movDuration to the duration of movProperties
+
+ set totalDuration to totalDuration + movDuration
+ close the front document
+
+ end repeat
+
+ end tell
+
+ set totalDurationSeconds to totalDuration / 1000
+ set totalDurationMinutes to (totalDurationSeconds / 60) as integer
set totalDurationSecondRemainder to (totalDurationSeconds mod 60) as integer
tell application "FastScripts"
- display message "Duration: " & totalDurationMinutes & ":" & totalDurationSecondRemainder dismissing after delay 10
- end
-
- on error errmsg
- --should anything go wrong let the user know
+ display message "Duration: " & totalDurationMinutes & ":" & totalDurationSecondRemainder dismissing after delay 10
+ end
+
+ on error errmsg
+ -- should anything go wrong let the user know
display dialog errmsg
end try
-end open
+end open
View
@@ -1,25 +0,0 @@
--- Originally from http://www.macosxhints.com/article.php?query=droplet&story=20040923120629702
-on open (theItems)
- try
- tell application "Finder"
- --repeat the command to compress each item as an individual archive
- repeat with oneItem in theItems
- --used to extract the name and location of the file
- set itemProp to properties of oneItem
- --where the file is
- set itemPath to quoted form of POSIX path of oneItem
- --where the compressed file should end up
- set destFold to quoted form of POSIX path of (container of itemProp as alias)
- --what the name of the file is
- set itemName to name of oneItem
- --do it asynchronously
- do shell script ("cd " & destFold & " && zip -r " & itemName & ".zip " & itemName & " &")
- end repeat
- -- Go back to Finder
- activate
- end tell
- on error errmsg
- --should anything go wrong let the user know
- display dialog errmsg
- end try
-end open

0 comments on commit 22294a2

Please sign in to comment.