One of the big problems I have with Skype is its lack of a scheduling feature.Â I have a Skype dual phone which will ring when someone calls me on Skype, but I donât want the phone ringing in the middle of the night because someone from another time zone sees my status as âOnlineâ decides to call.Â I use Skype frequently for work with virtual teams, so I canât just turn it off because I donât want to forget to turn it back on.Â My status should show as âAwayâ when I havenât used my PC for a while, but this isnât always consistent and it doesnât cater for insomnia-induced tinkering on the pc.
Ideally, Skype would have a feature to set âOpening Hoursâ on your accountâI only want to show up as available between 8am and 8pm.Â I bought the Pamela extra which does some scheduling, but you can set only one event per dayâie. I can set it to go offline at 8pm, but not to turn back on at 8am.
Since Skype offers a client API component, it is possible to create a scheduler to set your online status at different times using Windows Scheduler and a scripting tool.Â I wrote this before in VBScript, but this being the dawn of Windows 7 with pre-installed PowerShell, I rewrote it as a PowerShell script.
If you are on XP or Vista and havenât installed PowerShell, you will need to do this before you can run these scripts.Â Installation instructions for PowerShell are here.Â You will also need to set the execution policy.Â You can find instructions for this here.Â I am running XP.
I hope this helps . . .
Step 1: Install the Skype4Com component
Skype still uses a COM component called Skype4Com which needs to be downloaded and registered on your local PC.Â The component can be found at https://developer.skype.com/Download.Â Iâm using version 1.0.32, but you can probably use a later version.
Download the component, extract it to a directory (ie. “c:skype”) and type the following into the Run window:
Make sure the directory point to the actual dll file to you downloaded.Â You should get a response that it was registered successfully:
Step 2: Write the PowerShell script
Now, write the PowerShell script to use the component.Â Iâve created two scriptsâone sets my status to âOnlineâ, the other sets it to âOfflineâ.Â You can probably create a single script with a parameter passed in if you wish (but I couldnât be bothered to figure out how to do this).
In the script, you have to create the Skype object, identify the current user, and change the status.
In my first script, I use the following code:
The main Skype call here is the âChangeUserStatusâ method.Â I named the first script âSetSkypeStatus_on.ps1â.
The second script is almost identical, but it sets the status to âOfflineâ:
I named the second script âSetSkypeStatus_off.ps1â.
There are several other parameters you can pass into the âChangeUserStatusâ method.Â Here are the values I know about:
Of course, you can automate most actions on the Skype client using the component (not just setting your online status).Â You can schedule calls, send text messages, etc.Â But Iâm only concerned with my online status.
Step 3: Set up Windows Scheduled Tasks
Now you have two scripts to go Offline and Online.Â You just need to have something trigger them.Â I use Windows Scheduled Tasks.Â In Control Panel, go to the Scheduled Tasks window.Â Youâll see a list of scheduled tasks for your pc.Â Right client and select âAddââ>âScheduled Taskâ (Donât go through the âAdd Scheduled Taskâ wizard).Â Name your task âSkypeStatusOnâ.Â Right-click the task and choose âPropertiesâ.
Now, in the âRun:â box, type the following command:
powershell -command “& ‘c:tempSetSkypeStatus_on.ps1’ “
Make sure the path is pointed to you PowerShell script youâve created.
You can now use the âScheduleâ tab to schedule when you want the script to run.Â Click âOKâ.
Now do the same for the other script.Â You can test these scripts by right-clicking the task and selecting âRunâ.Â You should be able to watch your Skype status go from offline to online.
By the way, the first time you run this, Skype will ask if you want PowerShell to have access to Skype.Â Click âAllowâ.
If everything works successfully, your pc should set your online status and give you the âOpening Hoursâ that Skype forgot.
I hope you find this useful.