Traductor Google

sábado, 20 de julio de 2013

Añadir prefijo a TODOS los telefonos en el mac

Se hace con applescript
Instrucciones detalladas
https://discussions.apple.com/thread/2285262?start=0&tstart=0
https://gist.github.com/echoz/1426818
Script
tell application "Address Book"
set prefix to "+65"
repeat with p in (get people)
repeat with n in (get p's phones)
set num to ReplaceText(n's value, " ", "") of me
if (count num) is 8 then
set n's value to prefix & num
end if
end repeat
save p
end repeat
save
end tell
 
on ReplaceText(theString, fString, rString)
set current_Delimiters to text item delimiters of AppleScript
set AppleScript's text item delimiters to fString
set sList to every text item of theString
set AppleScript's text item delimiters to rString
set newString to sList as string
set AppleScript's text item delimiters to current_Delimiters
return newString
end ReplaceText

No hay comentarios:

Publicar un comentario