1
접촉이보다 존재하지 않는 경우를 결정하는보다 효율적인 방법이 :검색 Outlook 연락처 mdfind
set theAddress to "[email protected]"
set found to false
repeat with aContact in contacts
if email addresses of aContact contains theAddress then
set found to true
exit repeat
end if
end repeat
if not found then
...
end if
이 새 연락처를 만듭니다가 발견되지 않는 경우가 (그리고 true
을 반환) :
set found to open contact email address "[email protected]"
** 편집 **
Search Outlook contacts by category 내가 스포트라이트 쿼리를 사용하여이 작업을 수행 할 수 있어야한다고 제안 :
-- the address to be found
set theEmailAddress to "[email protected]"
-- search identity folder
set currentIdentityFolder to quoted form of POSIX path of (current identity folder as string)
--perform Spotlight query
set theContacts to words of (do shell script "mdfind -onlyin " & currentIdentityFolder & " 'kMDItemContentType == com.microsoft.outlook14.contact && [metadata element that represents an email address] == " & theEmailAddress & "' | xargs -I % mdls -name com_microsoft_outlook_recordID '%' | cut -d'=' -f2 | sort -u | paste -s -")
-- process results
...
연락처의 이메일 주소를 나타내는 메타 데이터 요소는 무엇입니까?