 |
 |
AppleScript help needed!
|
 |
|
 |
|
Mac Enthusiast
Join Date: May 2001
Location: United Knicker-dom
Status:
Offline
|
|
I only know one thing about AppleScript: I can use it to automate processes. I don't know how to write inthe language...or anything, but I'd like to use it in OS X to automate a couple of processes.
I'd like to be able to have Mail and IE (in OS X) open at 6.00 am in the morning. I know that IE will automatically go to my homepage, but I also want it to open up a second window and go ot www.bbc.co.uk. Mail will automatically fetch my mail, so that is no big problem.
So, what I'm asking, is if one of you guys could write this script for me, or at least help me do it...
The script must...
1. Wake my Mac from sleep at 6.00am
2. Open up Mail.
3. Open IE with two windows...on to my homepage, and the second window going to www.bbc.co.uk
Thanks for any help in advance.
Play it cool

|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Nov 2001
Location: Oregon
Status:
Offline
|
|
Check out the AppleScript section of this page for links to AppleScript resources: Things Macintosh
Also, from the Finder, choose "Help Center" from the "Help" menu, then select "AppleScript Help".
[ 01-05-2002: Message edited by: Rainy Day ]
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: May 2001
Location: United Knicker-dom
Status:
Offline
|
|
Originally posted by Rainy Day:
<STRONG>Check out the AppleScript section of this page for links to AppleScript resources: Things Macintosh
Also, from the Finder, choose "Help Center" from the "Help" menu, then select "AppleScript Help".
[ 01-05-2002: Message edited by: Rainy Day ]</STRONG>
Thats original./.don't think I haven't already done that?
Play it cool

|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Dec 1999
Location: USA
Status:
Offline
|
|
I'm not running  but maybe this app will help.
Good luck!
<font color = blue> Tom</font>
<font color = blue> Description:</font>
CronniX is a Aqua frontend to the powerful Unix tool "cron". Cron is a Unix system service that allows scheduled execution of scripts, programs, applications - in short anything that can be started from the command line. This includes OSX applications and AppleScripts.
<font color = green>* License: Freeware
* Author/Publisher: Koch und Schmidt Systemtechnik
* Release Date: September 9, 2001
* Requirements: Mac OS X</font>
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Feb 2001
Status:
Offline
|
|
Here's part of your script:
repeat until time of (current date) is 21600--21600=21600 seconds after midnight=0600 hours
end repeat
tell app "Mail"--this block completes requirement 2
run
end tell
tell app "Internet Explorer"--this block completes requirement 3
OpenURL "http://www.bbc.co.uk" toWindow 0
end tell
You can't wake your computer from sleep via AppleScript. Even if the script is running when the computer is put to sleep, the script's execution will be halted.
(120)
[ 01-08-2002: Message edited by: AppleScript ]
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status:
Offline
|
|
Originally posted by georgius:
<STRONG>
So, what I'm asking, is if one of you guys could write this script for me, or at least help me do it...
The script must...
1. Wake my Mac from sleep at 6.00am
2. Open up Mail.
3. Open IE with two windows...on to my homepage, and the second window going to www.bbc.co.uk
</STRONG>
First, your AppleScript cannot wake the machine since the script won't be running at the time you want to wake. Prior to Mac OS X, the Energy Saver control panel had options for waking the system at preset times. I don't see the same option under Mac OS X - anyone?
If you can't put the system to sleep then you can either do as AppleScript suggests, which is run the script continuously, checking the time and doing nothing until 6am, or you can use cron, Script Scheduler, or other time-based tool.
The problem with the first approach is that you'll constantly be using CPU cycles checking the time when 99.99% of the time you don't care.
A better approach is to write the script to do just the actions you want (Open Mail, IE, etc.) and separately control the execution.
To use cron (built into Mac OS X), open a command window and type:
<font face = "courier">
crontab -e</font>
this will edit your crontab (which is probably empty right now).
Then add the line:
0 6 * * * /path/to/your/script
This tells your system to execute /path/to/your/script at 6:00 every day (as long as the machine is turned on).
<font face = "courier">man cron</font> and <font face = "courier">man crontab</font> will give you more info on running cron, including how to schedule weekday-only execution (unless you get up at 6am on weekends, too).
|
|
Gods don't kill people - people with Gods kill people.
|
| |
|
|
|
 |
 |
|
 |
| |
|
|
|

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