Il telefono fisso dell'ufficio e' obsoleto perche' avete la rubrica sul PC o sul cellulare ed e' piu' facile chiamare con il cellulare ?
Ci sono pero' situazioni in cui non voglio usare il cellulare (ad esempio quando voglio tenere il cellulare spento per non farmi distrarre, per usare piani tariffari piu' convenienti per certe destinazioni o per chiamare altri numeri che sono on-net).
Ad esempio, tutta la mia famiglia usa squillo.it che offre account gratis e che ho configurato su dei port adapter (adattatori che consentono di attaccare un telefono tradizionale ad Internet) a casa di mio fratello, mio padre, sui loro PC, ecc..
Infine, in ufficio abbiamo un centralino SIP open source.
Ma cercare un numero sulla rubrica del Mac e comporlo sul telefono fisso dell'ufficio e' palloso e allora mi sono detto, perche' non fare uno script che piglia il numero dalla rubrica e al clic del mouse (ctrl-clic, per la precisione), farlo comporre in automatico a un programma sul mac che fa da softphone ?
ho installato x-lite (che e' gratuito), lo ho configurato con l'account squillo e, con l'aiuto di Marco, ho fatto lo script che trovate sotto.
Lo script va copiato e incollato nello ScriptEditor (sotto Applicazioni/AppleScript) e salvato nella cartella Libreria/Address Book Plug-Ins (io lo ho chiamato "dial").
using terms from application "Address Book"
(* script by Stefano Quintarelli http://blog.quintarelli.it *)
(* thanks to Marco Locatelli http://blog.marcolocatelli.com *)
on should enable action for aPerson with phoneNumber
return true
end should enable action
on action property
return "phone"
end action property
on prepare(phoneNumber)
(* The script supports switchboards which require a preselection *)
(* insert here the preselection digit *)
(* set PreselectionDigit to "0" *)
set PreselectionDigit to ""
(* The script supports country code removal so you can get rid of *)
(* country prefix if it is the same as where you are based *)
(* change "+39" to the country code prefix you have in your *)
(* address book entries *)
set HomeCountryCode to "+39"
set HomeCountryCodeLength to length of HomeCountryCode
set NumberToDial to value of phoneNumber as string
if NumberToDial contains HomeCountryCode then
set NumberToDial to PreselectionDigit & (characters (HomeCountryCodeLength + 1) through -1 of NumberToDial)
else if NumberToDial contains "+" then
set NumberToDial to PreselectionDigit & "00" & (characters 2 through -1 of NumberToDial)
else
set NumberToDial to PreselectionDigit & NumberToDial
end if
return NumberToDial
end prepare
on action title for aPerson with phoneNumber
return ("X-Lite - Call number " & prepare(phoneNumber))
end action title
on perform action for aPerson with phoneNumber
set NumberToDial to prepare(phoneNumber) as string
with timeout of 30 seconds
tell application "X-Lite"
activate
return «event Xtendial» (NumberToDial)
end tell
end timeout
end perform action
end using terms from



