Hack42.Schedule When Skype Runs the Mac Way


Hack 42. Schedule When Skype Runs the Mac Way

Use iCal and a little AppleScript to schedule when Skype runs, and when it does not.

Works with: Mac OS X version of Skype.

For Mac users who shun the command line, or simply don't know what crontabs isand don't want to knowthere is a simple way to have Skype start and stop on the days and at the times you choose. That way, you can control when you are available to receive calls and, at the same time, ration Skype's consumption of Internet bandwidth, which may be important if you need it for other things or if you pay for your Internet traffic by the megabyte or gigabyte.

iCal, Apple Computer's desktop calendar, has a really neat feature that allows you to associate an AppleScript with an event in your calendar. That event can be a one-off event, or it can be a recurring event that you specify for example, Monday through Friday, at 9 a.m. By defining two eventsone for when you want Skype to start running, and another for when you want Skype to stop runningand attaching scripts to those events, you can control when Skype runs and, almost as important, when it does not. The start event you define runs the skype_start.scpt AppleScript and the stop event you define runs skype_stop.scpt. Between these two bracketing events, Skype will run. At all other times, Skype won't run (unless you have set Skype to start when you start your machine and you reboot during the period of time outside the two bracketing events).

 -- File: skype_start.scpt do shell script "open a /Applications/Skype.app/Contents/MacOS/Skype" -- File: skype_stop.scpt do shell script "killall Skype" 

For example, to run Skype only from 9 a.m. to 5 p.m. each day, open iCal and define a new event (iCal File New Event). Set the event for 9 a.m. and make it repeat every day. Set the alarm for this event to run the script skype_stop.scpt. Your calendar should now have two events that bracket the period for which you want Skype to run, and it should look something like Figure 3-17.

Each day the start script will awake at 9 a.m. to start running Skype (which you should set up so that it automatically logs you onto your Skype account). Then, at 5 p.m., the stop script will run and will shut down Skype. Now you're available to take Skype calls only between 9 a.m. and 5 p.m., with the added advantage that outside that time period, Skype is consuming neither Internet bandwidth, nor machine resources (CPU and memory). As the saying goes, "If you don't need it, don't run it!"

Figure 3-17. Schedule when Skype starts running, and when it stops running, using iCal





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