Skype + Applescript = poor man’s voice web services

Skype is one of my favorite applications. I recently used Skype to call someone in Russia and it only cost a few cents. I’ve also been studying the Skype API, which opens some interesting possibilities.

On a Mac, you can combine simple Applescript commands with simple Skype commands to open a lot of possibilities. For example, this Applescript opens Skype and calls the best taco shop in Provo, UT:

tell application “Skype”
send command “CALL +18013774710” script name “Call the best taco shop in Provo, UT”
end tell

Skype can be scripted to automatically make phone calls, chat by video or text, or send text messages. You can also pipe in any audio or record the phone call.

This has interesting implications for companies like MacMiniColo.net that use Macs as servers (disclosure: I’m a friend of its owner and staff, and I’ve done contract work for them in the past.) Combining Applescript, Skype, shell scripting, and the say command, your server could be configured to call your cell phone when there’s an outage and tell you what the problem is.

Jon Udell’s podcast about communications-enabled business processes discusses the integration of voice calls into computer processes. They discuss examples where a business process may need approval from a supervisor. With voice integration, the computer could call a manager with a “press 1 to approve, press 2 to disapprove” message.

Skype + Applescript is sort of the poor man’s version of VOIP web services, but it’s exciting that you could actually do something interesting with it today.

10 replies on “Skype + Applescript = poor man’s voice web services”

  1. blazena: that can be more or less easily (albeit tediously) done by making three different scripts and attaching them to ical events. there’s probably a more savvy way of doing it, but that’s how i schedule sms messages.
  2. Hello, I would like to program and call some mobile telephone numbers .
    for example: 9:00 call to 782638947, 9:02 call to12398499, etc.
    Also, I want to call 3 different mobile phones at the same time.
    I tried to find it out online but unfortunately I couldnt find anything..
    I would be very happy if someone could help me for this. Thank you!
  3. yah Don I have a script here that I wrote for you just replace YOUR TEXT HERE with what you want to send in the message and replace YOUR PHONE NUMBER HERE with your phone number also, make sure to enable access for assistive devices.

    tell application “iChat”
    activate
    end tell
    tell application “System Events” to keystroke “n” using {command down, option down}

    — Type ‘phone #’
    delay 1.719537
    set timeoutSeconds to 2.0
    set uiScript to “keystroke \”YOUR PHONE NUMBER HERE
    \””
    my doWithTimeout(uiScript, timeoutSeconds)

    end run

    on doWithTimeout(uiScript, timeoutSeconds)
    set endDate to (current date) + timeoutSeconds
    repeat
    try
    run script “tell application \”System Events\”
    ” & uiScript & ”
    end tell”
    exit repeat
    on error errorMessage
    if ((current date) > endDate) then
    error “Can not ” & uiScript
    end if
    end try
    end repeat
    end doWithTimeout
    — Type ‘TEXT MESSAGE’
    delay 1.719537
    set timeoutSeconds2 to 2.0
    set uiScript2 to “keystroke \”YOUR TEXT HERE
    \””
    my doWithTimeout2(uiScript2, timeoutSeconds2)

    end run

    on doWithTimeout2(uiScript2, timeoutSeconds2)
    set endDate to (current date) + timeoutSeconds2
    repeat
    try
    run script “tell application \”System Events\”
    ” & uiScript2 & ”
    end tell”
    exit repeat
    on error errorMessage
    if ((current date) > endDate) then
    error “Can not ” & uiScript
    end if
    end try
    end repeat
    end doWithTimeout2
    end

  4. Hi there. Wondering if some kind person could help me. I’m desperately looking for a really simple applescript that will send me a simple SMS message. I have purchased EvoCam for my home security system which works incredibly well but I really need it to send me an sms when motion is detected.
    I’m sure this would be dead simple for anyone who knows how to applscript but unfortunately I don’t.
    Thanks in advance!
    Don

Comments are closed.