我正试图在撰写模式下获取并设置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
除非没有其他方法,否则我会避免使用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:"test@example.com"}}
#make new cc recipient at newMessage with properties {email address:{name:"Name", address:"test@example.com"}}
--- SET EMAIL BODY USING PLAIN TEXT ---
set plain text content of newMessage to "This is just a TEST."
open newMessage
end tell