(* Save the program as an application bundle when you're ready to make an executable *) -- Read the list o' URLs to load and pick one out. set domainListFile to "/Users/username/bin/domain_list.txt" set sites to paragraphs of (read (POSIX file domainListFile)) set rndNumber to random number from 1 to count sites (* If you wanted to reload just a single URL without the external text file, you'd just need to set targetURL to something and comment out all the crap above *) --set targetURL to "http://nukethemfromorbit.com/" set targetURL to item rndNumber of sites -- When it's 1am, we quit and restart Safari set myTime to time string of (current date) if myTime ³ "01:00:00 AM" and myTime ² "01:01:00 AM" then tell application "Safari" quit end tell -- Give Safari some time to exit delay 10 end if tell application "Safari" activate -- If there isn't a window open, create one if not (exists document 1) then make new document at the beginning of documents end if -- Set the URL to our homepage set the URL of the front document to targetURL -- If the window isn't zoomed all the way, zoom it -- Use javascript instead of zoom as it isn't reliable do JavaScript "moveTo(0,0);self.resizeTo(screen.availWidth,screen.availHeight)" in document 1 end tell