Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'An AppleScript that does some useful things at startup' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript that does some useful things at startup
Authored by: RedEyedEnglisher on Feb 14, '04 07:30:29AM

I've noticed that uploading this script to the page has garbled some stuff. Updated now as well. ***Note, the '?' after the first 'if' statement should be a 'greater than or equals' but never seems to come out the right way when I upload *** Try this. Works on Jaguar as well as Panther. Email me if any problems or suggestions for enhancements.

(*"Wotcher" - A Splendid Start Up Applescript (SSUA) for those too lazy to type or read much when they switch the computer on *)

(* Open for any kind of sauce (c) licence. Hope you enjoy. mattbrook@mac.com. If you want to send me banknotes do it via paypal, or even an email to say "I hate this it doesn't work." Absolutely no support or warranty given whatsoever *)

set theDate to current date
set theDay to weekday of theDate
set theTime to time of theDate

if the theTime ? 0 and the theTime < 43200 then say "Good morning Dave! It's " & theDay & "."
if the theTime > 43199 and the theTime < 57600 then say "Good afternoon gentlemen, I am a Hal 9000 computer!"
if the theTime > 57599 and the theTime < 64800 then say "Good evening Dave, I'm sorry but I don't think I can let you do that!"
if the theTime > 64799 and the theTime < 86400 then say "It's " & theDay & " night."

delay 2
say "I'll put some music on"

tell application "iTunes"
activate
set sound volume to 75
set theTrack to some file track of user playlist "All"
set theTrackName to name of theTrack
set theTrackArtist to artist of theTrack
play theTrack
set collapsed of window 1 to true
end tell

tell application "iTunes"
activate
set sound volume to 15
say "This is " & theTrackName & ", by " & theTrackArtist & ". "
set sound volume to 75
end tell

tell application "Internet Connect"
connect
set miniaturized of window 1 to true
end tell

delay 20

property theURL : "http://www.b3ta.com"
open location theURL

tell application "Safari" (* or whatever browser you use *)
set miniaturized of window 1 to true
end tell

tell application "Mail"
check for new mail
set miniaturized of window 1 to true

delay 30
set unreadCount to unread count of inbox
tell application "iTunes"
set sound volume to 15
if unreadCount is equal to 0 then say "You have no new messages!"
if unreadCount is equal to 1 then say "You have a new message!"
if unreadCount is greater than 1 then say "You have " & unreadCount & " new messages!"
set sound volume to 75
end tell
end tell



[ Reply to This | # ]