Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --initialise windows
- tell application "System Events"
- set visible of process "AppleScript Editor" to false
- end tell
- --Check new mail
- tell application "Mail"
- check for new mail
- end tell
- --count unread emails
- set unreadCount to 0
- set exlcudeMailboxes to {"Drafts", "Trash", "Sent", "Sent Messages", "Junk", "Spam", "Outbox"}
- tell application "Mail"
- -- get mailboxes with unread count
- set mailboxesWithUnreadMessages to mailboxes of accounts whose unread count is not 0
- set localMailboxesWithUnreadMessages to every mailbox whose unread count is not 0
- -- loop through all accounts and mailboxes
- set returnArray to {}
- repeat with currentAccount in mailboxesWithUnreadMessages & localMailboxesWithUnreadMessages
- repeat with currentMailbox in currentAccount
- -- get mailbox attributes
- set mailboxName to name of currentMailbox
- set mailboxCount to unread count of currentMailbox
- if mailboxName is not in exlcudeMailboxes then
- -- increment total count
- set unreadCount to unreadCount + mailboxCount
- end if
- end repeat
- end repeat
- end tell
- -- get the time
- -- hours
- set timeStr to time string of (current date)
- set Pos to offset of ":" in timeStr
- set theHour to characters 1 thru (Pos - 1) of timeStr as string
- set timeStr to characters (Pos + 1) through end of timeStr as string
- -- minutes
- set Pos to offset of ":" in timeStr
- set theMin to characters 1 thru (Pos - 1) of timeStr as string
- set timeStr to characters (Pos + 1) through end of timeStr as string
- set thetime to (theHour & ":" & theMin) as string
- --play alarm file
- set volume output volume 100
- tell application "VLC"
- activate
- open "/Users/admin1/Downloads/alarm.mp3"
- end tell
- delay 5
- --Say good morning
- set d to (date string of (current date))
- set volume output volume 80
- say "Good morning, it is time to wake up."
- say "It is " & d
- say "And the time is " & thetime
- --say number of unread emails
- delay 1
- say "you have " & unreadCount
- if unreadCount is equal to 1 then
- say "unread email"
- else
- say "unread emails"
- end if
- delay 2
- --load 720 ABC Radio
- tell application "Google Chrome"
- activate
- open location "http://www.abc.net.au/perth/programs/webcam_radio.htm?ref=listenliveradio"
- end tell
- delay 5
- say "Seven Twenty is now loading"
- --load today's weather
- tell application "Google Chrome"
- activate
- open location "http://www.abc.net.au/perth/weather/"
- end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement