Skip to content
Browse files

Modifications of rakefile to build all scripts, and other tweaks.

Most are hard-coded to specific apps and a 1680x1050 screen.
  • Loading branch information...
1 parent 4380a60 commit 303334ac98e0baaefe66650956196daf314c661c @topfunky committed Jun 12, 2008
Showing with 102 additions and 5 deletions.
  1. +1 −0 .gitignore
  2. +6 −4 Rakefile
  3. +27 −0 bdd-2up-swap.applescript
  4. +27 −0 bdd-2up.applescript
  5. +5 −1 center.applescript
  6. +12 −0 front-half-left.applescript
  7. +12 −0 front-half-right.applescript
  8. +12 −0 front-natural-left.applescript
View
1 .gitignore
@@ -0,0 +1 @@
+*.scpt
View
10 Rakefile
@@ -1,16 +1,18 @@
desc "Compile scripts to .scpt files"
task :compile do
- puts "Compiling center.applescript..."
- system "osacompile -o center.scpt center.applescript"
- puts "Compiling center.applescript..."
- system "osacompile -o maximize.scpt maximize.applescript"
+ Dir["*.applescript"].each do |script|
+ script_name = script.gsub(/\.applescript/, '')
+ puts "Compiling #{script_name}.applescript..."
+ system "osacompile -o #{script_name}.scpt #{script_name}.applescript"
+ end
puts "Done"
puts
end
desc "Install scripts to your scripts folder"
task :install => :compile do
puts "Copying scripts to your scripts folder"
+ system "mkdir -p ~/Library/Scripts"
system "cp *.scpt ~/Library/Scripts"
puts "Done"
puts
View
27 bdd-2up-swap.applescript
@@ -0,0 +1,27 @@
+-- Put Terminal on one side and TextMate on the other
+
+tell application "System Events"
+
+ -- TODO hide all other apps
+
+ tell process "Terminal"
+ -- 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 {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
27 bdd-2up.applescript
@@ -0,0 +1,27 @@
+-- Put Terminal on one side and TextMate on the other
+
+tell application "System Events"
+
+ -- TODO hide all other apps
+
+ tell process "Terminal"
+ -- 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 {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
6 center.applescript
@@ -4,7 +4,11 @@ delay 0.1
set AppleScript's text item delimiters to "x"
-set res to text returned of (display dialog "Enter the width x height:" default answer ((windowWidth & windowHeight) as text))
+-- 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"
if res is "" then
display dialog "You need to enter a correct response"
View
12 front-half-left.applescript
@@ -0,0 +1,12 @@
+-- Put frontmost window on left half
+
+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 {840, 1040}
+ set position of window 1 to {0, 20}
+ end tell
+
+end tell
View
12 front-half-right.applescript
@@ -0,0 +1,12 @@
+-- Put frontmost window on right half
+
+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 {840, 1040}
+ set position of window 1 to {840, 20}
+ end tell
+
+end tell
View
12 front-natural-left.applescript
@@ -0,0 +1,12 @@
+-- Put frontmost window on left half
+
+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 {1040, 1040}
+ set position of window 1 to {0, 20}
+ end tell
+
+end tell

0 comments on commit 303334a

Please sign in to comment.
Something went wrong with that request. Please try again.