[cig-commits] r15981 - doc/geodynamics.org/benchmarks/trunk

luis at geodynamics.org luis at geodynamics.org
Mon Nov 16 14:49:37 PST 2009


Author: luis
Date: 2009-11-16 14:49:36 -0800 (Mon, 16 Nov 2009)
New Revision: 15981

Modified:
   doc/geodynamics.org/benchmarks/trunk/reload-browser.scpt
Log:
Automated reloading in other browsers (Opera & Safari)

To use the other browsers, simply comment/un-comment the
relevant lines near the top of the script. For convenience,
we also don't activate our text editor directly. Instead,
we use Cmd-Tab to switch back to the previously active application.
This can also be changed by commenting/uncommenting the relevant
lines near the bottom of the script.

Modified: doc/geodynamics.org/benchmarks/trunk/reload-browser.scpt
===================================================================
--- doc/geodynamics.org/benchmarks/trunk/reload-browser.scpt	2009-11-16 22:49:28 UTC (rev 15980)
+++ doc/geodynamics.org/benchmarks/trunk/reload-browser.scpt	2009-11-16 22:49:36 UTC (rev 15981)
@@ -2,21 +2,25 @@
 -- http://developer.apple.com/mac/library/documentation/AppleScript/Conceptual/AppleScriptLangGuide/introduction/ASLR_intro.html
 
 on run argv
+    -- set theBrowser to "Safari"
+    -- set theBrowser to "Opera"
+    set theBrowser to "Firefox"
     if argv is equal to {} then
-        tell application "Firefox"
+        tell application theBrowser
             activate
             tell application "System Events"
-                tell process "Firefox" to keystroke "r" using {command down}
+                tell process theBrowser to keystroke "r" using {command down}
             end tell
         end tell
     else
         set theUrl to (item 1 of argv)
-        tell application "Firefox" to activate
-        do shell script "open -a Firefox " & theUrl
+        tell application theBrowser to activate
+        do shell script "open -a " & theBrowser & " " & theUrl
     end if
     delay 1
     -- tell application "MacVim" to activate
     -- tell application "Emacs" to activate
+    -- tell application "TextMate" to activate
     tell application "System Events" to keystroke tab using {command down}
 end run
 



More information about the CIG-COMMITS mailing list