2016-05-03 28 views
0

我想要在撰寫mode.setting值時獲取並設置outlook郵件正文不起作用。腳本有問題嗎?但獲得價值工作正常。無法使用appleScript在撰寫模式下設置Outlook郵件正文

activate application "Microsoft Outlook" 
tell application "System Events" 
    tell process "Microsoft Outlook" 
      get value of static text 1 of group 1 of UI element 1 of scroll area 4 of splitter group 1 of window 1 
      set value of static text 1 of group 1 of UI element 1 of scroll area 4 of splitter group 1 of window 1 to "sample text"  

    end tell 
end tell 

回答

1

我會避免使用UI腳本,除非沒有其他方法。

此腳本顯示如何設置郵件正文。

tell (current date) to get (it's month as integer) & "-" & day & "-" & (it's year as integer) 
set MyDay to the result as text 
set Mytitle to "Daily Email - " as text 
set Mytitle to Mytitle & MyDay 

tell application "Microsoft Outlook" 

    set newMessage to make new outgoing message with properties {subject:Mytitle} 
    make new recipient at newMessage with properties {email address:{name:"Name", address:"[email protected]"}} 
    #make new cc recipient at newMessage with properties {email address:{name:"Name", address:"[email protected]"}} 

    --- SET EMAIL BODY USING PLAIN TEXT --- 
    set plain text content of newMessage to "This is just a TEST." 

    open newMessage 
end tell 
相關問題