2017-02-18 3 views
0

먼저 나쁜 영어로 죄송합니다. 나는 독일에서 왔고 여기 다른 커뮤니티에서 내 문제에 대한 도움이나 아이디어를 찾을 수 없습니다.AppleScript로 OS X 10.12.3의 연락처에서 "내 카드"를 정의 된 이름 또는 전자 메일 주소로 설정하십시오.

이메일 주소가 "johndoe @ ..."인 사람에게 내 카드를 설정하거나 "John Doe"라는 사람에게서 내 카드를 설정하는 작은 스크립트를 작성하려고합니다. 둘 다 괜찮지만 선호합니다. 이메일 주소.

여기서 도움을 얻을 수 있기를 바랍니다.

발견 한 스크립트 하나만 작동하지 않습니다.

tell application "Contacts" 
activate 
try 
set my card to people whose first name is "John" and last name is "Doe" 
end try 
quit 
end tell 

감사의 도움과 인사 앤디

+0

에 오신 것을 환영합니다 SO 검색! 이미 올바른 장소에 물어 봤습니다. (http://apple.stackexchange.com/q/273476/31378). [여러 스택 Exchange 사이트에서 크로스 게시 질문이 있습니까?] (http://meta.stackexchange.com/q/64068/349071)를 참조하십시오. –

답변

1

당신은 당신은 인수와 일치하는 1st 사람을 얻을 수있는

tell application "Contacts" 
    activate 
    try 
     set my card to 1st person whose first name is "John" and last name is "Doe" 
     save 
    end try 
    quit 
end tell 

을 아주 가까이 그리고 당신은 주소록을 저장해야합니다.

또는 이메일

tell application "Contacts" 
    activate 
    try 
     set my card to 1st person whose value of emails contains "[email protected]" 
     save 
    end try 
    quit 
end tell 
+0

고맙습니다. 작동이 좋습니다. 당신의 도움은 나를 행복하게 만듭니다. –

+0

Keine Ursache (환영합니다). – vadian

+0

Herzlichen Dank –

0
tell application "Safari" to activate 
tell application "System Events" 
    click menu item "Verlauf löschen …" of menu 1 of menu bar item "Verlauf" of menu bar 1 of process "Safari" 
    try 
     click button "Verlauf löschen" of front window of process "Safari" 
    on error 
     try 
      click button "Verlauf löschen" of sheet 1 of window 1 of process "Safari" 
     end try 
    end try 
end tell 
tell application "Safari" to close every window 
tell application "Safari" 
    make new document with properties {URL:"https://www.startpage.com/deu/#hmb"} 
end tell