 |
 |
AppleScript for Safari (Post Below Broken)
|
 |
|
 |
|
Mac Enthusiast
Join Date: Feb 2000
Location: Old Dominion University, Norfok, VA
Status:
Offline
|
|
Hello all, I'm on a university network and I usually have things downloading while I'm in classes or at work. The network logs users off when there is no Internet access detected through a Web browser. Since Safari saves login IDs and passes in the Keychain, I was wondering if someone could give me the steps to make an AppleScript that would tell Safari to open a Web page every 30 minutes. Any and all help is greatfully appreciated! Thanks!
|
iPond317 | ODU Apple Campus Rep
"Ten years ago down by the lake I sunk my sweet love down to her watery grave." - Hello Again | DMB
Old: Apple IIc, PowerMac 7200/90, iMac Bondi Blue 233, Titanium PowerBook G4 400 - New: MacBook 2.0, iPhone 8GB, AirPort Extreme Gb, iPod 30GB 5th Gen
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Nov 2002
Location: Rouge River
Status:
Offline
|
|
Originally posted by iPond317:
Hello all, I'm on a university network and I usually have things downloading while I'm in classes or at work. The network logs users off when there is no Internet access detected through a Web browser. Since Safari saves login IDs and passes in the Keychain, I was wondering if someone could give me the steps to make an AppleScript that would tell Safari to open a Web page every 30 minutes. Any and all help is greatfully appreciated! Thanks!
Well, you need to do something like:
Code:
repeat every 10 minutes
tell application "Safari"
close every window
make new document at beginning of documents
set URL of document 1 to item i of URLs
end tell
end repeat
You can alter this with a list of URLs, and then have Safari open up a random URL every 10 minutes so that some automatic script won't detect that you're using a keep alive function.
BTW, I'm not absolutely sure that will function. I'm new to OS X, and by no means an applescript guru.
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Sep 2000
Location: Cupertino, CA USA
Status:
Offline
|
|
To have a script wait, you need to use an Idle handler.
Save this script as an application with the "Stay Open" option checked in the Save Dialog. It will send the command to open the page every 10 minutes (10 * 60 seconds = 600 seconds).
Code:
on idle
tell application "Safari"
if not (exists document 1) then
make new document at the beginning of documents
end if
set the URL of document 1 to "http://www.apple.com"
end tell
return 600
end idle
If Safari is setup as your default browser in the Internet System Pane, you can use this approach:
Code:
on idle
open location "http://www.apple.com"
return 600
end idle
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |