2012-04-10 3 views
2

Active Directory에서 정보를 가져 와서 Mac 용 Microsoft Outlook에서 새 서명을 만드는 스크립트를 작성했습니다. strName 내가 다른 곳에서 얻을 서명의 이름입니다AppleScript로 Mac 서명을위한 기본 Microsoft Outlook 설정

tell application "Microsoft Outlook" 

    make new signature with properties {name:strName, content:contentHTML, plain text content:"", include in random:false} 

end tell 

을 :

나는 (정말 관련이없는 것처럼 내가 밖으로 다른 코드를 떠나) 서명을 만들려면 다음 코드를 사용 contentHTML은 다른 곳에 구축 한 HTML의 실제 서명입니다.

이 서명을 Microsoft Outlook에 추가하는 작업은 완벽하지만 현재 서명 한 서명을 현재 계정의 기본 서명으로 설정하는 방법을 볼 수 없습니다. 나는 전혀 도움이되지 않은 많은 연구를 해왔고, 나는 또한 사전을 훑어 보았다.

+0

AppleScript 또는 쉘 스크립트로는이 작업을 수행 할 수 없습니다. Outlook 2011은 폴더에있는 데이터베이스에 서명 및 메일 계정을 저장합니다./Documents/Microsoft User Data/Office 2011 Identities/주요 신원 /'. 계정에서 기본 서명까지의 매핑이 어딘가에있을 것이라고 확신하지만, Outlook을 알지 못하면 (데이터베이스 파일을 수정할 때 Outlook에서 다음 시작시 다시 작성)주의를 기울이지 않아도됩니다. – fanaugen

+0

답장을 보내 주셔서 감사합니다. 나는 그것에 대해 살펴볼 것입니다 :). 이러한 종류의 기능은 Outlook에서 유용합니다. – Frank

답변

3

이 작업은 AppleScript로 수행 할 수 있습니다. Outlook 2011 사전에는 특별히이 작업을 수행 할 수있는 것이 없으므로 대신 UI 요소를 스크립팅하여 수행 할 수 있습니다. 이는 분명히 다소 혼란 스럽습니다.

서명은 계정별로 설정되므로이 스크립트에 계정의 이름과 해당 계정에 설정할 서명의 이름을 제공해야합니다.

setDefaultSignature to "strName" for "Gmail" 

on setDefaultSignature to mySignature for accountName 
    tell application "Microsoft Outlook" to activate 
    tell application "System Events" 
    -- turn on UI automation - may throw a permissions dialog 
    if UI elements enabled is false then set UI elements enabled to true 

    click menu item "Preferences..." of menu 1 of menu bar item "Outlook" of menu bar 1 of application process "Outlook" 
    click item 1 of (buttons of window "Outlook Preferences" of application process "Outlook" whose description is "Signatures") 
    click button "Default Signatures..." of window "Signatures" of application process "Outlook" 

    repeat with thisRow in rows of table 1 of scroll area 1 of sheet 1 of window "Signatures" of application process "Outlook" 
     if value of text field of thisRow as string is accountName then 
     click pop up button 1 of thisRow 
     click menu item mySignature of menu 1 of pop up button 1 of thisRow 
     click button "OK" of sheet 1 of window "Signatures" of application process "Outlook" 
     click item 1 of (buttons of window "Signatures" of application process "Outlook" whose description is "close button") 
     exit repeat 
     end if 
    end repeat 
    end tell 
end setDefaultSignature 
+0

& Frank이 문제를 해결하고 동료가 실행할 수있는 스크립트를 만들 수 있으며 HTML 파일을 기반으로 서명을 설치하는지 알고 있습니까? (osx 또는 MacOS에서 Outlook) – OnkelK

관련 문제