Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Integrate Skype users into Address Book Apps
Skype is a fairly new, neat VoiceOverIP application which uses less bandwith then iChat, and you can talk to Windows users as well as calling normal phones (the offline world still exists!). Browsing the Skype Forums one day, I found this thread which contains an Address Book plug-in script for Skype users. A user named bertimike wrote the script, and has made it available for download (4KB) on his .Mac page.

This plug-in only works for phone numbers (or Skype names within the phone fields of Address Book). However, you can work around this by placing two copies in your /Library -> Address Book Plug-Ins folder. Then change the phone action property in one of them into jabber, and rename the script. This one now becomes active for any "chat" entry of your contacts. Just place their Skype name there.

[robg adds: To help save bertimike's bandwidth, I've decided to reproduce the script in the remainder of this hint. So you can either click above to download, or read the rest of the hint to see the source...]

Here's the AppleScript code for this plug-in:
using terms from application "Address Book"
  on action property
    return "phone"  
  end action property
  
  on action title for p with e
    return "Call with Skype"
  end action title
  
  on should enable action for p with e
    return true
  end should enable action
  
  on perform action for p with e
    
    set x to value of e as string
    if character 1 of x is not "+" then
      set x to "+1" & x
    end if
    
    set SKYPEurl to "callto://" & x
    tell application "Skype"
      get URL SKYPEurl
      activate
    end tell
    return true
  end perform action
end using terms from
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[37,349 views]  

Integrate Skype users into Address Book | 10 comments | Create New Account
Click here to return to the 'Integrate Skype users into Address Book' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Integrate Skype users into Address Book
Authored by: ryansking on Dec 29, '04 01:36:26PM

This is cool, but could be cooler– does anyone know how to add Skype as an option for the IM field? I'm looking through the plist's and stuff, but I'm not finding anything yet.



[ Reply to This | # ]
Integrate Skype users into Address Book
Authored by: ryansking on Dec 29, '04 06:33:05PM

While I'm thinking about this, I remember seeing somewhere that someone had a method for finding hidden preferences. I don't mean just finding items in plist's that have un-exposed options. I remember reading about a way to searcht he binaries for symbols.

Anyone out there understand what I'm talking about?



[ Reply to This | # ]
Integrate Skype users into Address Book
Authored by: Krazy on Dec 29, '04 11:24:08PM
I remember reading about a way to search binaries for symbols...

From Terminal, try "strings" on the binary.... as always, YMMV ;-)

[ Reply to This | # ]

Integrate Skype users into Address Book
Authored by: terryb on Dec 29, '04 05:50:06PM

Bravo !!



[ Reply to This | # ]
Integrate Skype users into Address Book
Authored by: zed on Dec 30, '04 03:06:34AM

If you don't live in the US then you will need to adjust the script..

You'll see a '+1' in the script, you might need to play around with this to make it work with international numbers better.

Cheers,
--Zed :cool:

---
macosx.miraworld.tv



[ Reply to This | # ]
Integrate Skype users into Address Book
Authored by: ACOL on Dec 30, '04 05:18:29AM

Hi,

I live in the UK, and can't get the script to work fully.

I've tried replacing the +1 in the script with +44, but no joy. Skype opens up, but doesn't try to connect to anything. It just briefly flashes a "User calling to you" message and then stops doing anything.

The script works fine with numbers where + and the country code are already typed in in Address Book, but any suggestions as to how to get it to work for local-format (0*** **** ****) numbers would be much appreciated.

Thanks,

ACOL



[ Reply to This | # ]
Integrate Skype users into Address Book
Authored by: petergort on Dec 30, '04 02:13:32PM

Since I don't intend to use Skype's PSTN gateway (I live in the wonderful land of Oz, so anybody I call would automatically be an overseas call) I didn't want to use the phone field for Skype addresses. In Address Book, you can choose "Other" for the property name and enter what you like, so I entered "Skype" as a property for my contact in address book. Then in the script I changed the property value from "phone" to "skype", and wll do so for any Skype contacts I aquire. Now when I want to choose an action, Skype contacts in the addressbook have the "Call with Skype" option, but phone ones don't.



[ Reply to This | # ]
Integrate Skype users into Address Book
Authored by: scstsut on Feb 28, '05 02:19:12PM

Here's what I did to make it work, both to call phone numbers that are in Address Book's Phone fields and to call Skype user id's that are in the IM/Jabber fields:

I pasted the Applescript above into Script Editor (in applications > applescript).

First I changed:

  on action title for p with e
    return "Call with Skype"
  end action title

To:

  on action title for p with e
    return "SkypeOut"
  end action title

Because I preferred the context menu to have a shorter item.

Then "Save As...": SkypeOut.scpt in Library > Address Book Plug-Ins.

Then I changed:

  on action title for p with e
    return "SkypeOut"
  end action title

To:

  on action title for p with e
    return "SkypeMe"
  end action title

And:

  on action property
    return "phone"  
  end action property

To:

  on action property
    return "jabber"  
  end action property

And:

    set x to value of e as string
    if character 1 of x is not "+" then
      set x to "+1" & x
    end if

To:

    set x to value of e as string

Meaning that I simply deleted:

    if character 1 of x is not "+" then
      set x to "+1" & x
    end if

And then "Saved As...": SkypeMe.scpt in the same folder.

If Address Book is open, quit and reopen it.

You should then get "SkypeOut" in the context menu when you click on "home", "work", "mobile", etc in the address field

and

"SkypeMe" in the context menu when you click on "home", "work", etc, in an IM/Jabber field.


Now, does anyone have the smarts to do the same thing so that I can have the option to "SkypeIM" from the Address Book to do a text/IM?

And, to do a plug-in for Adium so that I can IM from the Address Book?




[ Reply to This | # ]
Integrate Skype users into Address Book
Authored by: willjwade on May 21, '05 05:23:47AM
Ok the thing is all these applescripts are great and all that but what if your numbers arent internationally formatted?? Answer.. use the code below (NB: You may need to edit the prefix(es). I reckon for version 2 of this someone might like to do something clever by working that out from the address book..):

using terms from application "Address Book"
on action property
return "phone"
end action property

on action title for p with e
return "Dial with Skype"
end action title

on should enable action for p with e
return true
end should enable action

on perform action for p with e
set phone_num to the value of e


-- strip non-numeric characters
set numeric to ""
repeat with i from 1 to the number of characters in phone_num
if character i of phone_num is in {"+", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"} then set numeric to numeric & character i of phone_num
end repeat
set phone_num to numeric

-- replace local prefixes "0" or "00" with international prefix
set prefix to ""
set cutoff to 0
set taster to character 1 of phone_num
set taster to taster & character 2 of phone_num
if taster is "00" then
set prefix to "+"
set cutoff to 2
end if
if taster is in {"01", "02", "03", "04", "05", "06", "07", "08", "09"} then
set prefix to "+44 "
set cutoff to 1
end if

set new_num to prefix
repeat with i from cutoff + 1 to the number of characters in phone_num
set new_num to new_num & character i of phone_num

end repeat
set phone_num to new_num

skype_out(phone_num)
end perform action

end using terms from

on skype_out(phone_num)
tell application "Skype"
set call_string to "callto:" & phone_num
get URL call_string
end tell
end skype_out
Found in the comments at this blog - written by Benet Allen.

[ Reply to This | # ]
Integrate Skype users into Address Book
Authored by: willjwade on May 21, '05 05:47:20AM
Ok, the daddy of all scripts can be found here: http://homepage.mac.com/jcmallery/qualityshareware/

[ Reply to This | # ]