2016-05-03 7 views
0

festgelegt werden Ich versuche, Outlook Nachrichtentext im Kompositionsmodus zu erhalten und festlegen. Setting-Wert funktioniert nicht. stimmt etwas mit dem Skript nicht? aber Wert erhalten funktioniert gut.Outlook Textkörper kann nicht im Compose-Modus mit AppleScript

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 

Antwort

1

Ich würde vermeiden, UI Scripting zu verwenden, wenn es keinen anderen Weg gibt.

Dieses Skript zeigt Ihnen, wie Sie den Nachrichtentext festlegen.

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 
Verwandte Themen