MACSCRPT Archives

October 2007

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Lively <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Wed, 3 Oct 2007 16:21:00 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (43 lines)
On Oct 3, 2007, at 3:55 PM, Stockly, Ed wrote:

> I'm working on a script that controls Safari, Firefox and/or iCab.
>
> When any of these browsers display pages that have some specific ads  
> and
> javascript they will crash or cause the Finder to crash.
>
> My script can detect when the browser or the finder have  
> unexpectedly quit
> and can clear the dialog and relaunch.
>
> What I can't do is figure out how to determine if the browser has  
> frozen and
> is not responding, and how to force quit the browser.
>
Try this

with timeout of 15* seconds
	get application "Safari"
on error
	KillSafari()
end

do shell script "killall Safari"

> I'm also looking for a way to force restart the mac, without  
> worrying about
> saving or logging off nicely.
>

do shell script "shutdown -r now" password "password" with  
administrator privileges

> These scripts are running on mac minis who's only functon in life is  
> to
> display web pages.
>
> Any suggestions?
>
> ES
>

ATOM RSS1 RSS2