Hack94.Schedule Calls and Chat Using iCal on the Mac


Hack 94. Schedule Calls and Chat Using iCal on the Mac

Have you ever forgotten to make or return an important call? Well, that can be a thing of the past if you have iCal place the call for you at the right time and on the right date.

Works with: Mac OS X version of Skype.

iCal on the Mac has a neat feature whereby you can attach an AppleScript to an event and have it run precisely on a date and at a time that you choose.

To schedule a Skype call, simply create a short AppleScriptsay, call_pete.scptthat uses the Skype API to start the call for you. Note that after the CALL command you can have either a Skype username or a telephone number (if you are a SkypeOut subscriber). Next you must associate this script with an event in iCal. You can do this by selecting "Run script" from the "alarm" option for an event (see Figure 12-5).

At the duly appointed date and time, the script will run, and Skype will pop up and start the call. Clearly, however, scheduled calls are for times when you're sure you'll be sitting at your computer! Likewise, you can schedule conference calls in a similar way (using a command such as CALL skypeuser1 +442075551212 skypeuser2, for instance, listing up to four conference call participants after the CALL statement).

 -- File: call_pete.scpt tell application "Skype"     send command "CALL +12035551212" script name "Call Pete" end tell 

You can also schedule chat messages in the same manner. Suppose you have a regular team meeting at noon every Wednesday. You can send a chat message reminder to all team members five minutes before the start of the meeting by attaching a script, such as chat_team.scpt, to a recurring event in iCal:

Figure 12-5. Attaching a script to an event in iCal


 -- File: chat_team.scpt tell application "Skype"     set msg to " Weekly team meeting in 5 minutes, room 101"     send command "MESSAGE skypeteam1" & msg script name "Team member 1"     send command "MESSAGE skypeteam2" & msg script name "Team member 2"     send command "MESSAGE skypeteam3" & msg script name "Team member 3"     send command "MESSAGE skypeteam4" & msg script name "Team member 4" end tell 

In the chat_team.scpt script, pay particular attention to the fact that there must be whitespace between the Skype username and the message text.

12.5.1. Hacking the Hack

Just as you can't call yourself in Skype, you can't send a chat message to only yourself (though the latter isn't entirely true). If you send a chat message to echo123, it will be reflected back to you. This means you can send chat messages to yourself, which at first glance seems pointlessuntil you realize that such messages in combination with iCal mean that you can send yourself reminders using Skype chat! This is particularly useful if you regularly log onto Skype on several machines under different Skype usernames, which might be the case if you have several machines at home or at the office and you roam from one to the next, or if you travel with a laptop. Your schedule is centralized on one machine, but your reminders are distributed. Simply attach a script such as chat_reminder.scpt to an event in iCal, and no matter where you are logged onto Skype, your reminder will grab your attention.

 -- File: chat_reminder.scpt tell application "Skype"      set msg to " Dental appointment at 4:30 p.m."      send command "MESSAGE echo123" & msg script name "Self"      send command "MESSAGE skypehome" & msg script name "Home"      send command "MESSAGE skypeoffice" & msg script name "Office"      send command "MESSAGE skypelaptop" & msg script name "Laptop"      send command "MESSAGE skypepocket" & msg script name "Pocket PC" end tell 




Skype Hacks
Skype Hacks: Tips & Tools for Cheap, Fun, Innovative Phone Service
ISBN: 0596101899
EAN: 2147483647
Year: 2005
Pages: 168

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net