Traductor Google

miércoles, 4 de septiembre de 2013

Añadir prefijos con applescritp

Para los contactos en Contacts del osx
http://yjsoon.com/2011/12/applescript-to-add-65-prefix-to-address-book
"A very useful AppleScript by Jeremy Foo to add a +65 Singapore country code prefix to any 8-digit number. Run this script* if you’d like to use your email address as your iMessage caller ID, per my previous post."
Y luego
https://gist.github.com/echoz/1426818
Copia esto en AppleScript cambiando el 8 x 9 y poniendo el prefijo de españa.

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
Me ha dado error pero ha cambiado muchos numeros bien. Para volver a ejecutarlo volver a cerrar applescript y volver a hacerlo

No hay comentarios:

Publicar un comentario