Re: Script to automate Safari....
Re: Script to automate Safari....
- Subject: Re: Script to automate Safari....
- From: Andrew Oliver <email@hidden>
- Date: Mon, 06 Mar 2006 17:36:52 -0800
On 3/6/06 12:33 PM, "Roy A. Baril" <email@hidden> wrote:
> Hey all,
>
> I need a script (or program) to help my automate Safari. I would rather
> not re-invent the wheel if someone has already done this. What I need is this:
>
> I have a plasma TV hooked up to a Mini-Mac (with keyboard and mouse). It is
> in the lobby of our school. I want to have safari running in full screen
> mode cycling through a number of URL's in a timed fashion. The URL's are
> the front pages of a list of newspaper (both national and international)
> sites. This would run continously, unattended.
>
> Anybody got any ideas?
This is trivial to do with a stay-open script:
property theURLs : {"http://www.apple.com/", "http://www.otherplace.com/",
"http://somewhereelse.com/"}
global currentURL
on run
set currentURL to 1
tell application "Safari"
set URL of document 1 to item currentURL of theURLs
end tell
end run
on idle
set currentURL to (currentURL + 1)
if currentURL > (count theURLs) then set currentURL to 1
tell application "Safari"
set URL of document 1 to item currentURL of theURLs
end tell
return 30
end idle
Save it as a 'stay-open' application and every 30 seconds ('return 30") the
script will increment the counter and display the appropriate URL.
Note the complete lack of error checking (e.g. making sure document 1
actually exists, gracefully trapping errors, etc.), but that's up to you. :)
Andrew
:)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden