 |
 |
Simple AppleScript Program
|
 |
|
 |
|
Forum Regular
Join Date: Nov 2000
Status:
Offline
|
|
Hi All,
I want to create a simple AppleScript program that will open Internet Explorer every hour and go to a particular website.
I don't know how to do this... I've searched the Apple site and have came up short.
Does anyone know how I could learn how to do this?
This may not be the correct forum for this... sorry if that is the case.
Thanks for your time.
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Nov 2000
Status:
Offline
|
|
I forgot to mention that I'm running 10.3
|
|
|
| |
|
|
|
 |
|
 |
|
Posting Junkie
Join Date: Nov 2001
Location: Retired.
Status:
Offline
|
|
Wouldn't this involve some sort of daemon constantly running in the background?
|
|
|
| |
|
|
|
 |
|
 |
|
Moderator Emeritus 
Join Date: Mar 2001
Location: Austin, MN, USA
Status:
Offline
|
|
Originally posted by gorickey:
Wouldn't this involve some sort of daemon constantly running in the background?
Yes, and since we all already have such a daemon running, we should make use of it. This daemon is cron.
There are two ways. You can open the browser window, like you're wanting to do, or if you just want the page to load and don't care about seeing it, you can use curl from the command line. I use curl to update my dynamic DNS IP once every half hour.
First, you will need CronniX. It's a simple GUI editor for cron and it's free.
General Step: You will need to do this no matter which way you want it to work. In CronniX, hit the "New" button. Set the minute to 0, and click the "any" box for hour, day of month, month, and day of week. The command depends on which way you want it.
To have it open a web page, set the command to:
osascript -e 'open location "http://www.macnn.com"' > /dev/null
To have it just load the URL (for dynamic IP updating or counter increase, for example), use the command:
curl "http://www.macnn.com" > /dev/null
Change "http://www.macnn.com" to whatever URL you want to open. Make sure you click the "Save" button in CronniX when you're done editing.
Hope this helps.
(
Last edited by Xeo; Nov 10, 2003 at 05:08 PM.
)
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Sep 2000
Location: Cupertino, CA USA
Status:
Offline
|
|
Originally posted by dvwannabe:
Hi All,
I want to create a simple AppleScript program that will open Internet Explorer every hour and go to a particular website.
I don't know how to do this... I've searched the Apple site and have came up short.
Does anyone know how I could learn how to do this?
This may not be the correct forum for this... sorry if that is the case.
Thanks for your time.
Here you go. Save this script as an application with the Stay Open option checked.
It assumes that Internet Explorer is your default browser.
Code:
on idle
ignoring application responses
open location "http://www.apple.com"
end ignoring
return 3600
end idle
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Sep 2000
Location: Cupertino, CA USA
Status:
Offline
|
|
|
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
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
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|