text [Formatier Kontakte]Fügt+ 49 vor jede Telefonnummer #macos #applescript

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text [Formatier Kontakte]Fügt+ 49 vor jede Telefonnummer #macos #applescript相关的知识,希望对你有一定的参考价值。

set vorwahl to "+49"
tell application "Contacts"
	repeat with aPerson in people
		set thePhones to phones of aPerson
		if thePhones is not {} then
			set errorList to {}
			repeat with aPhoneNumber in thePhones
				set theNumber to value of aPhoneNumber
				
				if (characters 1 thru 1 of theNumber) as string is "0" then
					if (characters 1 thru 2 of theNumber) as string is not "00" then
						try
							set StringLength to count of characters in theNumber
							set newNumber to vorwahl & (characters 2 thru StringLength of theNumber)
							display dialog theNumber & " to " & newNumber
							
							set value of aPhoneNumber to newNumber
						on error
							copy name of aPerson to end of errorList
						end try
					end if
				end if
			end repeat
			if errorList is not {} then
				display dialog "Couldn't change: " & items of errorList
			end if
		end if
	end repeat
	save
end tell

以上是关于text [Formatier Kontakte]Fügt+ 49 vor jede Telefonnummer #macos #applescript的主要内容,如果未能解决你的问题,请参考以下文章

<!-- text --> 和 /* text */ 注释有啥区别?

VB中 如何复制Text1.text的字体到剪贴板? 如何剪切?

VB 加减乘除

text-decoration:[ text-decoration-line ] || [ text-decoration-style ] || [ text-decoration-color ]

.text 和 .get_text() 之间的区别

javascript或css:如何隐藏标签内的文本中的任何数字,后跟点前缀“1.text”,“2.text”...“30.text”