2017-04-17 2 views
-2

AppleScript를 사용하여 Mac 용 Outlook 2016에서 가장 최근 메시지의 내용을 어떻게 표시합니까?AppleScript를 사용하여 가장 최근의 Microsoft Outlook 2016 메시지를 읽는 방법

나는 같은 것을 수행 할 수 있습니다

tell application "Microsoft Outlook" 
    return unread count of messages 
end tell 

을하지만 오류 얻을 : 내 시작했다

error "Microsoft Outlook got an error: Can’t get unread count of every message." number -1728 from unread count of every message 

을하지만 난 거기에서 무엇을 해야할지하지 않습니다.

답변

0

이렇게하는 방법입니다. 그것은 당신이 파일> 열기 사전> Microsoft Outlook을 애플 스크립트 편집기를 개방하여 Outlook 2016의 모든 작업을 찾은 다음을 선택할 수 있습니다

on writeTextToFile(theText, theFile, overwriteExistingContent) 
    try 

     -- Convert the file to a string 
     set theFile to theFile as string 

     -- Open the file for writing 
     set theOpenedFile to open for access file theFile with write permission 

     -- Clear the file if content should be overwritten 
     if overwriteExistingContent is true then set eof of theOpenedFile to 0 

     -- Write the new content to the file 
     write theText to theOpenedFile starting at eof 

     -- Close the file 
     close access theOpenedFile 

     -- Return a boolean indicating that writing was successful 
     return true 

     -- Handle a write error 
    on error 

     -- Close the file 
     try 
      close access file theFile 
     end try 

     -- Return a boolean indicating that writing failed 
     return false 
    end try 
end writeTextToFile 

tell application "Microsoft Outlook" 
    set theMessage to first item of (get current messages) 
    get subject of theMessage 
    set theContent to (content of theMessage) 
end tell 

set theFile to (((path to desktop folder) as string) & "first-message-content.txt") 
writeTextToFile(theContent, theFile, true) 

"첫 번째 메시지 content.txt"에 가장 최근의 메시지 내용을 기록 .